diff mbox series

phy: tegra: xusb: Add error pointer check in xusb.c

Message ID 20240930191101.13184-1-kdipendra88@gmail.com
State Accepted
Commit e70d2677ef4088d59158739d72b67ac36d1b132b
Headers show
Series phy: tegra: xusb: Add error pointer check in xusb.c | expand

Commit Message

Dipendra Khadka Sept. 30, 2024, 7:11 p.m. UTC
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>
---
 drivers/phy/tegra/xusb.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Thierry Reding Oct. 21, 2024, 12:50 p.m. UTC | #1
On Mon, Sep 30, 2024 at 07:11:00PM +0000, Dipendra Khadka wrote:
> 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>
> ---
>  drivers/phy/tegra/xusb.c | 2 ++
>  1 file changed, 2 insertions(+)

Acked-by: Thierry Reding <treding@nvidia.com>
Vinod Koul Oct. 22, 2024, 5:32 a.m. UTC | #2
On Mon, 30 Sep 2024 19:11:00 +0000, Dipendra Khadka wrote:
> Add error pointer check after tegra_xusb_find_lane().
> 
> 

Applied, thanks!

[1/1] phy: tegra: xusb: Add error pointer check in xusb.c
      commit: e70d2677ef4088d59158739d72b67ac36d1b132b

Best regards,
diff mbox series

Patch

diff --git a/drivers/phy/tegra/xusb.c b/drivers/phy/tegra/xusb.c
index cfdb54b6070a..342f5ccf611d 100644
--- a/drivers/phy/tegra/xusb.c
+++ b/drivers/phy/tegra/xusb.c
@@ -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