* [PATCH] usb: phy: check the return value of ioremap() in usb_otg_start()
@ 2022-07-22 3:19 ` williamsukatube
0 siblings, 0 replies; 2+ messages in thread
From: williamsukatube @ 2022-07-22 3:19 UTC (permalink / raw)
To: ran.wang_1, balbi, linux-usb, linuxppc-dev, linux-kernel
Cc: gregkh, William Dean, Hacash Robot
From: William Dean <williamsukatube@gmail.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@santino.com>
Signed-off-by: William Dean <williamsukatube@gmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* [PATCH] usb: phy: check the return value of ioremap() in usb_otg_start()
@ 2022-07-22 3:19 ` williamsukatube
0 siblings, 0 replies; 2+ messages in thread
From: williamsukatube @ 2022-07-22 3:19 UTC (permalink / raw)
To: ran.wang_1, balbi, linux-usb, linuxppc-dev, linux-kernel
Cc: Hacash Robot, gregkh, William Dean
From: William Dean <williamsukatube@gmail.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@santino.com>
Signed-off-by: William Dean <williamsukatube@gmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-07-22 7:45 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-22 3:19 [PATCH] usb: phy: check the return value of ioremap() in usb_otg_start() williamsukatube
2022-07-22 3:19 ` williamsukatube
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.