Patch "phy: tegra: xusb: check return value of devm_kzalloc()" has been added to the 6.1-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

    phy: tegra: xusb: check return value of devm_kzalloc()

to the 6.1-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:
     phy-tegra-xusb-check-return-value-of-devm_kzalloc.patch
and it can be found in the queue-6.1 subdirectory.

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



commit 8637ddd8383dc9ffc1fee7d1f52cf61a6ce290b2
Author: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>
Date:   Wed May 31 10:39:50 2023 +0300

    phy: tegra: xusb: check return value of devm_kzalloc()
    
    [ Upstream commit 44faada0f38fc333d392af04c343b0e23f8f5d81 ]
    
    devm_kzalloc() returns a pointer to dynamically allocated memory.
    Pointer could be NULL in case allocation fails. Check pointer validity.
    Identified with coccinelle (kmerr.cocci script).
    
    Fixes: f67213cee2b3 ("phy: tegra: xusb: Add usb-role-switch support")
    Signed-off-by: Claudiu Beznea <claudiu.beznea@xxxxxxxxxxxxx>
    Acked-by: Thierry Reding <treding@xxxxxxxxxx>
    Link: https://lore.kernel.org/r/20230531073950.145339-1-claudiu.beznea@xxxxxxxxxxxxx
    Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index c3fa22ee2d8d4..4d5b4071d47d5 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -670,6 +670,9 @@ static int tegra_xusb_setup_usb_role_switch(struct tegra_xusb_port *port)
 	port->dev.driver = devm_kzalloc(&port->dev,
 					sizeof(struct device_driver),
 					GFP_KERNEL);
+	if (!port->dev.driver)
+		return -ENOMEM;
+
 	port->dev.driver->owner	 = THIS_MODULE;
 
 	port->usb_role_sw = usb_role_switch_register(&port->dev,



[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