OpenCloudOS-Kernel/drivers/usb/phy
Fabio Estevam 4993508653 usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28
Commit e93650994a ("usb: phy: mxs: add usb charger type detection")
causes the following kernel hang on i.MX28:

[    2.207973] usbcore: registered new interface driver usb-storage
[    2.235659] Unable to handle kernel NULL pointer dereference at virtual address 00000188
[    2.244195] pgd = (ptrval)
[    2.246994] [00000188] *pgd=00000000
[    2.250676] Internal error: Oops: 5 [#1] ARM
[    2.254979] Modules linked in:
[    2.258089] CPU: 0 PID: 1 Comm: swapper Not tainted 4.15.0-rc8-next-20180117-00002-g75d5f21 #7
[    2.266724] Hardware name: Freescale MXS (Device Tree)
[    2.271921] PC is at regmap_read+0x0/0x5c
[    2.275977] LR is at mxs_phy_charger_detect+0x34/0x1dc

mxs_phy_charger_detect() makes accesses to the anatop registers via regmap,
however i.MX23/28 do not have such registers, which causes a NULL pointer
dereference.

Fix the issue by doing a NULL check on the 'regmap' pointer.

Fixes: e93650994a ("usb: phy: mxs: add usb charger type detection")
Cc: <stable@vger.kernel.org> # v4.15
Reviewed-by: Li Jun <jun.li@nxp.com>
Acked-by: Peter Chen <peter.chen@nxp.com>
Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
2018-02-12 10:51:37 +02:00
..
Kconfig usb: phy: remove phy-qcom-8x16-usb.c 2017-11-01 17:08:10 +01:00
Makefile USB/PHY patches for 4.15-rc1 2017-11-13 21:14:07 -08:00
of.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-ab8500-usb.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-am335x-control.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
phy-am335x-control.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy-am335x.c USB: add SPDX identifiers to all remaining files in drivers/usb/ 2017-11-04 11:48:02 +01:00
phy-fsl-usb.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-fsl-usb.h USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-generic.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-generic.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
phy-gpio-vbus-usb.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-isp1301-omap.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-isp1301.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-keystone.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-mv-usb.c USB: move many drivers to use DEVICE_ATTR_WO 2018-01-24 08:49:52 +01:00
phy-mv-usb.h USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-mxs-usb.c usb: phy: mxs: Fix NULL pointer dereference on i.MX23/28 2018-02-12 10:51:37 +02:00
phy-omap-otg.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-tahvo.c USB: move many drivers to use DEVICE_ATTR_RO 2018-01-24 08:49:52 +01:00
phy-tegra-usb.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-twl6030-usb.c USB: move many drivers to use DEVICE_ATTR_RO 2018-01-24 08:49:52 +01:00
phy-ulpi-viewport.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy-ulpi.c USB: phy: Remove redundant license text 2017-11-07 15:45:01 +01:00
phy.c usb: phy: Factor out the usb charger initialization 2017-12-12 13:04:03 +02:00