Skip to content

Commit b52fe2d

Browse files
Yuuoniygregkh
authored andcommitted
usb: dwc3: qcom: Fix NULL vs IS_ERR checking in dwc3_qcom_probe
Since the acpi_create_platform_device() function may return error pointers, dwc3_qcom_create_urs_usb_platdev() function may return error pointers too. Using IS_ERR_OR_NULL() to check the return value to fix this. Fixes: c25c210 ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot") Signed-off-by: Miaoqian Lin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 01ec4a2 commit b52fe2d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

drivers/usb/dwc3/dwc3-qcom.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -775,9 +775,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev)
775775

776776
if (qcom->acpi_pdata->is_urs) {
777777
qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev);
778-
if (!qcom->urs_usb) {
778+
if (IS_ERR_OR_NULL(qcom->urs_usb)) {
779779
dev_err(dev, "failed to create URS USB platdev\n");
780-
return -ENODEV;
780+
if (!qcom->urs_usb)
781+
return -ENODEV;
782+
else
783+
return PTR_ERR(qcom->urs_usb);
781784
}
782785
}
783786
}

0 commit comments

Comments
 (0)