Patch "mtd: powernv: Add check devm_kasprintf() returned value" has been added to the 6.10-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

    mtd: powernv: Add check devm_kasprintf() returned value

to the 6.10-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:
     mtd-powernv-add-check-devm_kasprintf-returned-value.patch
and it can be found in the queue-6.10 subdirectory.

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



commit 9f7c620f31650bdad64694195695c40467deea5e
Author: Charles Han <hanchunchao@xxxxxxxxxx>
Date:   Wed Aug 28 17:24:27 2024 +0800

    mtd: powernv: Add check devm_kasprintf() returned value
    
    [ Upstream commit 395999829880a106bb95f0ce34e6e4c2b43c6a5d ]
    
    devm_kasprintf() can return a NULL pointer on failure but this
    returned value is not checked.
    
    Fixes: acfe63ec1c59 ("mtd: Convert to using %pOFn instead of device_node.name")
    Signed-off-by: Charles Han <hanchunchao@xxxxxxxxxx>
    Signed-off-by: Miquel Raynal <miquel.raynal@xxxxxxxxxxx>
    Link: https://lore.kernel.org/linux-mtd/20240828092427.128177-1-hanchunchao@xxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/mtd/devices/powernv_flash.c b/drivers/mtd/devices/powernv_flash.c
index 66044f4f5bade..10cd1d9b48859 100644
--- a/drivers/mtd/devices/powernv_flash.c
+++ b/drivers/mtd/devices/powernv_flash.c
@@ -207,6 +207,9 @@ static int powernv_flash_set_driver_info(struct device *dev,
 	 * get them
 	 */
 	mtd->name = devm_kasprintf(dev, GFP_KERNEL, "%pOFP", dev->of_node);
+	if (!mtd->name)
+		return -ENOMEM;
+
 	mtd->type = MTD_NORFLASH;
 	mtd->flags = MTD_WRITEABLE;
 	mtd->size = size;




[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