usb: dwc3: core: avoid NULL pointer dereference
authorFelipe Balbi <balbi@ti.com>
Thu, 2 Jul 2015 03:03:09 +0000 (22:03 -0500)
committerFelipe Balbi <balbi@ti.com>
Mon, 6 Jul 2015 17:34:08 +0000 (12:34 -0500)
commit43cacb03aabe62158d8e5da876054c7d48fc9963
tree5ff1cca4d2cc79240eb078659dcd6beb9ccf07d0
parentcc1e204cb092da8495fe2c24bdc4543c259d6b34
usb: dwc3: core: avoid NULL pointer dereference

commit 3e10a2ce98d1 ("usb: dwc3: add hsphy_interface
property") introduced a possible NULL pointer
dereference because dwc->hsphy_interface can be
NULL.

In order to fix it, all we have to do is guard
strncmp() against a NULL argument.

Fixes: 3e10a2ce98d1 ("usb: dwc3: add hsphy_interface property")
Tested-by: Murali Karicheri <m-karicheri2@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/dwc3/core.c