* [-next] usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()
@ 2018-07-31 14:36 Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2018-07-31 14:36 UTC (permalink / raw)
To: Wei Yongjun, Felipe Balbi, Greg Kroah-Hartman; +Cc: linux-usb, kernel-janitors
Hi,
On 31-07-18 16:38, Wei Yongjun wrote:
> In case of error, the function pcim_iomap() returns NULL pointer not
> ERR_PTR(). The IS_ERR() test in the return value check should be
> replaced with NULL test.
>
> Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not")
> Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Thank you for catching this:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> drivers/usb/dwc3/dwc3-pci.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
> index 5edd794..1286076 100644
> --- a/drivers/usb/dwc3/dwc3-pci.c
> +++ b/drivers/usb/dwc3/dwc3-pci.c
> @@ -85,8 +85,8 @@ static int dwc3_byt_enable_ulpi_refclock(struct pci_dev *pci)
> u32 value;
>
> reg = pcim_iomap(pci, GP_RWBAR, 0);
> - if (IS_ERR(reg))
> - return PTR_ERR(reg);
> + if (!reg)
> + return -ENOMEM;
>
> value = readl(reg + GP_RWREG1);
> if (!(value & GP_RWREG1_ULPI_REFCLK_DISABLE))
>
---
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* [-next] usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock()
@ 2018-07-31 14:38 weiyongjun (A)
0 siblings, 0 replies; 2+ messages in thread
From: weiyongjun (A) @ 2018-07-31 14:38 UTC (permalink / raw)
To: Felipe Balbi, Hans de Goede, Greg Kroah-Hartman
Cc: Wei Yongjun, linux-usb, kernel-janitors
In case of error, the function pcim_iomap() returns NULL pointer not
ERR_PTR(). The IS_ERR() test in the return value check should be
replaced with NULL test.
Fixes: 7740d04d901d ("usb: dwc3: pci: Enable ULPI Refclk on platforms where the firmware does not")
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
---
drivers/usb/dwc3/dwc3-pci.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
index 5edd794..1286076 100644
--- a/drivers/usb/dwc3/dwc3-pci.c
+++ b/drivers/usb/dwc3/dwc3-pci.c
@@ -85,8 +85,8 @@ static int dwc3_byt_enable_ulpi_refclock(struct pci_dev *pci)
u32 value;
reg = pcim_iomap(pci, GP_RWBAR, 0);
- if (IS_ERR(reg))
- return PTR_ERR(reg);
+ if (!reg)
+ return -ENOMEM;
value = readl(reg + GP_RWREG1);
if (!(value & GP_RWREG1_ULPI_REFCLK_DISABLE))
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-07-31 14:38 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-31 14:38 [-next] usb: dwc3: pci: Fix return value check in dwc3_byt_enable_ulpi_refclock() weiyongjun (A)
-- strict thread matches above, loose matches on Subject: below --
2018-07-31 14:36 Hans de Goede
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).