summaryrefslogtreecommitdiffstats
path: root/drivers/usb/phy/phy-mxs-usb.c
diff options
context:
space:
mode:
authorStefan Wahren <stefan.wahren@i2se.com>2015-06-15 06:37:00 +0200
committerFelipe Balbi <balbi@ti.com>2015-07-06 19:34:08 +0200
commit543aa4867d4a2dff5fc11e1b688197ee3bad7f89 (patch)
tree3b41e60a230bf09b9fab76565932f8f5cf1a9517 /drivers/usb/phy/phy-mxs-usb.c
parentusb: gadget: udc: fix free_irq() after request_irq() failed (diff)
downloadlinux-543aa4867d4a2dff5fc11e1b688197ee3bad7f89.tar.xz
linux-543aa4867d4a2dff5fc11e1b688197ee3bad7f89.zip
usb: phy: mxs: suspend to RAM causes NULL pointer dereference
Triggering suspend to RAM via sysfs on a i.MX28 causes a NULL pointer dereference. This patch avoids the oops in mxs_phy_get_vbus_status() by aborting since there is no syscon available. Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com> Fixes: efdbd3a5d6e ("usb: phy: mxs: do not set PWD.RXPWD1PT1 for low speed connection") CC: <stable@vger.kernel.org> # 4.0 Acked-by: Peter Chen <peter.chen@freescale.com> Signed-off-by: Felipe Balbi <balbi@ti.com>
Diffstat (limited to 'drivers/usb/phy/phy-mxs-usb.c')
-rw-r--r--drivers/usb/phy/phy-mxs-usb.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/phy/phy-mxs-usb.c b/drivers/usb/phy/phy-mxs-usb.c
index 8f7cb068d29b..3fcc0483a081 100644
--- a/drivers/usb/phy/phy-mxs-usb.c
+++ b/drivers/usb/phy/phy-mxs-usb.c
@@ -217,6 +217,9 @@ static bool mxs_phy_get_vbus_status(struct mxs_phy *mxs_phy)
{
unsigned int vbus_value;
+ if (!mxs_phy->regmap_anatop)
+ return false;
+
if (mxs_phy->port_id == 0)
regmap_read(mxs_phy->regmap_anatop,
ANADIG_USB1_VBUS_DET_STAT,