projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c3b69ba
)
ipack: Check dev_set_name() return value
author
Bo Liu
<liubo03@inspur.com>
Fri, 5 Aug 2022 09:10:57 +0000
(
05:10
-0400)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Thu, 1 Sep 2022 14:39:48 +0000
(16:39 +0200)
It's possible that dev_set_name() returns -ENOMEM, catch and handle this.
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: Bo Liu <liubo03@inspur.com>
Link:
https://lore.kernel.org/r/20220805091057.19951-1-liubo03@inspur.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/ipack/ipack.c
patch
|
blob
|
history
diff --git
a/drivers/ipack/ipack.c
b/drivers/ipack/ipack.c
index b1c3198355e7667f77cc7eba87c779eea81a535a..74d449858a61b29d8023a5ba78a4e386d7e7ef75 100644
(file)
--- a/
drivers/ipack/ipack.c
+++ b/
drivers/ipack/ipack.c
@@
-429,8
+429,11
@@
int ipack_device_init(struct ipack_device *dev)
dev->dev.bus = &ipack_bus_type;
dev->dev.release = ipack_device_release;
dev->dev.parent = dev->bus->parent;
- dev_set_name(&dev->dev,
+
ret =
dev_set_name(&dev->dev,
"ipack-dev.%u.%u", dev->bus->bus_nr, dev->slot);
+ if (ret)
+ return ret;
+
device_initialize(&dev->dev);
if (dev->bus->ops->set_clockrate(dev, 8))