Commit 621d5d6a authored by Bo Liu's avatar Bo Liu Committed by Greg Kroah-Hartman

ipack: Check dev_set_name() return value

It's possible that dev_set_name() returns -ENOMEM, catch and handle this.
Acked-by: default avatarSamuel Iglesias Gonsalvez <siglesias@igalia.com>
Signed-off-by: default avatarBo Liu <liubo03@inspur.com>
Link: https://lore.kernel.org/r/20220805091057.19951-1-liubo03@inspur.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c3b69ba5
......@@ -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))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment