driver core: location: Check for allocations failure
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 5 May 2022 10:32:59 +0000 (13:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 May 2022 07:58:34 +0000 (09:58 +0200)
commitbc443c31def574e3bfaed50cb493b8305ad79435
treebd8f946c9f85a7fa2b36b45c5ae68649eb6fcc51
parentc3d438eeb5413111889edef10cb5fcc2c0fb8bc9
driver core: location: Check for allocations failure

Check whether the kzalloc() succeeds and return false if it fails.

Fixes: 6423d2951087 ("driver core: Add sysfs support for physical location of a device")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YnOn28OFBHHd5bQb@kili
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/physical_location.c