Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f609a139 authored by Tarun Gupta's avatar Tarun Gupta
Browse files

USB: ehci-msm: Avoid possible null pointer dereference



devm_usb_get_phy can return null and value retuned by it is used in
otg_se_host so handle if devm_usb_get_phy retuns null and avoid null
pointer dereference.

CRs-fixed: 562868
Change-Id: Ic9e4069bf78254072bb07a6fc4d2c014b1cb8708
Signed-off-by: default avatarTarun Gupta <tarung@codeaurora.org>
parent 61a09d4a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -134,7 +134,7 @@ static int ehci_msm_probe(struct platform_device *pdev)
	 * management.
	 */
	phy = devm_usb_get_phy(&pdev->dev, USB_PHY_TYPE_USB2);
	if (IS_ERR(phy)) {
	if (IS_ERR_OR_NULL(phy)) {
		dev_err(&pdev->dev, "unable to find transceiver\n");
		ret = -ENODEV;
		goto put_hcd;