Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stefan Wahren and committed by
Felipe Balbi
543aa486 2184fe63

+3
+3
drivers/usb/phy/phy-mxs-usb.c
··· 217 217 { 218 218 unsigned int vbus_value; 219 219 220 + if (!mxs_phy->regmap_anatop) 221 + return false; 222 + 220 223 if (mxs_phy->port_id == 0) 221 224 regmap_read(mxs_phy->regmap_anatop, 222 225 ANADIG_USB1_VBUS_DET_STAT,