]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
phy: tegra: xusb: Add error pointer check in xusb.c
authorDipendra Khadka <kdipendra88@gmail.com>
Mon, 30 Sep 2024 19:11:00 +0000 (19:11 +0000)
committerVinod Koul <vkoul@kernel.org>
Mon, 21 Oct 2024 18:04:42 +0000 (23:34 +0530)
Add error pointer check after tegra_xusb_find_lane().

Fixes: e8f7d2f409a1 ("phy: tegra: xusb: Add usb-phy support")
Signed-off-by: Dipendra Khadka <kdipendra88@gmail.com>
Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20240930191101.13184-1-kdipendra88@gmail.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/tegra/xusb.c

index cfdb54b6070a45cb4609d945775d06cc9406aff0..342f5ccf611d879f65acaa1161e6e4e5b0b1736e 100644 (file)
@@ -699,6 +699,8 @@ static int tegra_xusb_setup_usb_role_switch(struct tegra_xusb_port *port)
                return -ENOMEM;
 
        lane = tegra_xusb_find_lane(port->padctl, "usb2", port->index);
+       if (IS_ERR(lane))
+               return PTR_ERR(lane);
 
        /*
         * Assign phy dev to usb-phy dev. Host/device drivers can use phy