* [PATCH] usb: dwc3: fix NULL pointer issue
@ 2020-05-06 10:58 Chunfeng Yun
0 siblings, 0 replies; only message in thread
From: Chunfeng Yun @ 2020-05-06 10:58 UTC (permalink / raw)
To: u-boot
The phy_bulk pointer *usb_phys is used before allocated,
fix it by using a phy_bulk variable instead in
xhci_dwc3_platdata struct
Signed-off-by: Chunfeng Yun <chunfeng.yun@mediatek.com>
---
drivers/usb/host/xhci-dwc3.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci-dwc3.c b/drivers/usb/host/xhci-dwc3.c
index 563db1a426..51c04a9de2 100644
--- a/drivers/usb/host/xhci-dwc3.c
+++ b/drivers/usb/host/xhci-dwc3.c
@@ -19,7 +19,7 @@
#include <linux/usb/otg.h>
struct xhci_dwc3_platdata {
- struct phy_bulk *usb_phys;
+ struct phy_bulk phys;
};
void dwc3_set_mode(struct dwc3 *dwc3_reg, u32 mode)
@@ -124,7 +124,7 @@ static int xhci_dwc3_probe(struct udevice *dev)
hcor = (struct xhci_hcor *)((uintptr_t)hccr +
HC_LENGTH(xhci_readl(&(hccr)->cr_capbase)));
- ret = dwc3_setup_phy(dev, plat->usb_phys);
+ ret = dwc3_setup_phy(dev, &plat->phys);
if (ret && (ret != -ENOTSUPP))
return ret;
@@ -167,7 +167,7 @@ static int xhci_dwc3_remove(struct udevice *dev)
{
struct xhci_dwc3_platdata *plat = dev_get_platdata(dev);
- dwc3_shutdown_phy(dev, plat->usb_phys);
+ dwc3_shutdown_phy(dev, &plat->phys);
return xhci_deregister(dev);
}
--
2.25.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2020-05-06 10:58 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-06 10:58 [PATCH] usb: dwc3: fix NULL pointer issue Chunfeng Yun
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.