diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2021-12-22 11:18:23 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-01-06 15:26:21 +0100 |
commit | b52fe2dbb3e655eb1483000adfab68a219549e13 (patch) | |
tree | daab9a55440b872ee78d27bb15295786ac224992 /drivers/usb | |
parent | 01ec4a2e8f01f027a0f06cad237c935da8d643bf (diff) | |
download | linux-b52fe2dbb3e655eb1483000adfab68a219549e13.tar.gz |
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: c25c210f590e ("usb: dwc3: qcom: add URS Host support for sdm845 ACPI boot")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20211222111823.22887-1-linmq006@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/dwc3/dwc3-qcom.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c index 5257783f17b0..6cba990da32e 100644 --- a/drivers/usb/dwc3/dwc3-qcom.c +++ b/drivers/usb/dwc3/dwc3-qcom.c @@ -775,9 +775,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) if (qcom->acpi_pdata->is_urs) { qcom->urs_usb = dwc3_qcom_create_urs_usb_platdev(dev); - if (!qcom->urs_usb) { + if (IS_ERR_OR_NULL(qcom->urs_usb)) { dev_err(dev, "failed to create URS USB platdev\n"); - return -ENODEV; + if (!qcom->urs_usb) + return -ENODEV; + else + return PTR_ERR(qcom->urs_usb); } } } |