Patch "ipmi: ipmb: Add check devm_kasprintf() returned value" has been added to the 5.4-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ipmi: ipmb: Add check devm_kasprintf() returned value

to the 5.4-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ipmi-ipmb-add-check-devm_kasprintf-returned-value.patch
and it can be found in the queue-5.4 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit d2f2a1debd8f67772563d029b7e6b711fae96c66
Author: Charles Han <hanchunchao@xxxxxxxxxx>
Date:   Thu Sep 26 17:44:19 2024 +0800

    ipmi: ipmb: Add check devm_kasprintf() returned value
    
    [ Upstream commit 2378bd0b264ad3a1f76bd957caf33ee0c7945351 ]
    
    devm_kasprintf() can return a NULL pointer on failure but this
    returned value is not checked.
    
    Fixes: 51bd6f291583 ("Add support for IPMB driver")
    Signed-off-by: Charles Han <hanchunchao@xxxxxxxxxx>
    Message-ID: <20240926094419.25900-1-hanchunchao@xxxxxxxxxx>
    Signed-off-by: Corey Minyard <corey@xxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/char/ipmi/ipmb_dev_int.c b/drivers/char/ipmi/ipmb_dev_int.c
index 09e3e25562a89..f56b92880cdaf 100644
--- a/drivers/char/ipmi/ipmb_dev_int.c
+++ b/drivers/char/ipmi/ipmb_dev_int.c
@@ -309,6 +309,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);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux