Patch "spi: intel: 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

    spi: intel: 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:
     spi-intel-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 5b3563e3fa325b6b51fb519a41f428cacc567c70
Author: Charles Han <hanchunchao@xxxxxxxxxx>
Date:   Fri Aug 30 15:41:06 2024 +0800

    spi: intel: Add check devm_kasprintf() returned value
    
    [ Upstream commit 2920294686ec23211637998f3ec386dfd3d784a6 ]
    
    intel_spi_populate_chip() use devm_kasprintf() to set pdata->name.
    This can return a NULL pointer on failure but this returned value
    is not checked.
    
    Fixes: e58db3bcd93b ("spi: intel: Add default partition and name to the second chip")
    Signed-off-by: Charles Han <hanchunchao@xxxxxxxxxx>
    Reviewed-by: Mika Westerberg <mika.westerberg@xxxxxxxxxxxxxxx>
    Link: https://patch.msgid.link/20240830074106.8744-1-hanchunchao@xxxxxxxxxx
    Signed-off-by: Mark Brown <broonie@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/spi/spi-intel.c b/drivers/spi/spi-intel.c
index 3e5dcf2b3c8a..795b7e72baea 100644
--- a/drivers/spi/spi-intel.c
+++ b/drivers/spi/spi-intel.c
@@ -1390,6 +1390,9 @@ static int intel_spi_populate_chip(struct intel_spi *ispi)
 
 	pdata->name = devm_kasprintf(ispi->dev, GFP_KERNEL, "%s-chip1",
 				     dev_name(ispi->dev));
+	if (!pdata->name)
+		return -ENOMEM;
+
 	pdata->nr_parts = 1;
 	parts = devm_kcalloc(ispi->dev, pdata->nr_parts, sizeof(*parts),
 			     GFP_KERNEL);




[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