mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
ipmi: ipmb: Add check devm_kasprintf() returned value
devm_kasprintf() can return a NULL pointer on failure but this
returned value is not checked.
Fixes: 51bd6f2915 ("Add support for IPMB driver")
Signed-off-by: Charles Han <hanchunchao@inspur.com>
Message-ID: <20240926094419.25900-1-hanchunchao@inspur.com>
Signed-off-by: Corey Minyard <corey@minyard.net>
This commit is contained in:
parent
11a299a793
commit
2378bd0b26
|
|
@ -321,6 +321,9 @@ static int ipmb_probe(struct i2c_client *client)
|
|||
ipmb_dev->miscdev.name = devm_kasprintf(&client->dev, GFP_KERNEL,
|
||||
"%s%d", "ipmb-",
|
||||
client->adapter->nr);
|
||||
if (!ipmb_dev->miscdev.name)
|
||||
return -ENOMEM;
|
||||
|
||||
ipmb_dev->miscdev.fops = &ipmb_fops;
|
||||
ipmb_dev->miscdev.parent = &client->dev;
|
||||
ret = misc_register(&ipmb_dev->miscdev);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user