[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20220722031913.2925655-1-williamsukatube@163.com>
Date: Fri, 22 Jul 2022 11:19:13 +0800
From: williamsukatube@....com
To: ran.wang_1@....com, balbi@...nel.org, linux-usb@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, linux-kernel@...r.kernel.org
Cc: gregkh@...uxfoundation.org,
William Dean <williamsukatube@...il.com>,
Hacash Robot <hacashRobot@...tino.com>
Subject: [PATCH] usb: phy: check the return value of ioremap() in usb_otg_start()
From: William Dean <williamsukatube@...il.com>
The function ioremap() in usb_otg_start() can fail, so
its return value should be checked.
Fixes: 0807c500a1a6d ("USB: add Freescale USB OTG Transceiver driver")
Reported-by: Hacash Robot <hacashRobot@...tino.com>
Signed-off-by: William Dean <williamsukatube@...il.com>
---
drivers/usb/phy/phy-fsl-usb.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c
index 972704262b02..21b3b2d57358 100644
--- a/drivers/usb/phy/phy-fsl-usb.c
+++ b/drivers/usb/phy/phy-fsl-usb.c
@@ -855,6 +855,8 @@ int usb_otg_start(struct platform_device *pdev)
* with host/device */
usb_dr_regs = ioremap(res->start, sizeof(struct usb_dr_mmap));
+ if (!usb_dr_regs)
+ return -ENOMEM;
p_otg->dr_mem_map = (struct usb_dr_mmap *)usb_dr_regs;
pdata->regs = (void *)usb_dr_regs;
--
2.25.1
Powered by blists - more mailing lists