Patch "firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()" has been added to the 5.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

    firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()

to the 5.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:
     firmware-raspberrypi-fix-possible-memory-leak-in-rpi.patch
and it can be found in the queue-5.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 74888919387a819101bcc20a7784b96c7c63d0c5
Author: Yang Yingliang <yangyingliang@xxxxxxxxxx>
Date:   Thu Nov 17 15:06:36 2022 +0800

    firmware: raspberrypi: fix possible memory leak in rpi_firmware_probe()
    
    [ Upstream commit 7b51161696e803fd5f9ad55b20a64c2df313f95c ]
    
    In rpi_firmware_probe(), if mbox_request_channel() fails, the 'fw' will
    not be freed through rpi_firmware_delete(), fix this leak by calling
    kfree() in the error path.
    
    Fixes: 1e7c57355a3b ("firmware: raspberrypi: Keep count of all consumers")
    Signed-off-by: Yang Yingliang <yangyingliang@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20221117070636.3849773-1-yangyingliang@xxxxxxxxxx
    Acked-by: Joel Savitz <jsavitz@xxxxxxxxxx>
    Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/firmware/raspberrypi.c b/drivers/firmware/raspberrypi.c
index 1d965c1252ca..9eef49da47e0 100644
--- a/drivers/firmware/raspberrypi.c
+++ b/drivers/firmware/raspberrypi.c
@@ -265,6 +265,7 @@ static int rpi_firmware_probe(struct platform_device *pdev)
 		int ret = PTR_ERR(fw->chan);
 		if (ret != -EPROBE_DEFER)
 			dev_err(dev, "Failed to get mbox channel: %d\n", ret);
+		kfree(fw);
 		return ret;
 	}
 



[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