Re: [PATCH] usb: gadget: xudc: fix return value check in xudc_probe()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/16/2015 02:17 PM, weiyj_lk@xxxxxxx wrote:
> From: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> 
> In case of error, the function devm_ioremap_resource() returns
> ERR_PTR() and never returns NULL. The NULL test in the return
> value check should be replaced with IS_ERR().
> 
> Signed-off-by: Wei Yongjun <yongjun_wei@xxxxxxxxxxxxxxxxx>
> ---
>  drivers/usb/gadget/udc/udc-xilinx.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/gadget/udc/udc-xilinx.c b/drivers/usb/gadget/udc/udc-xilinx.c
> index dd3e9fd..cfe0349 100644
> --- a/drivers/usb/gadget/udc/udc-xilinx.c
> +++ b/drivers/usb/gadget/udc/udc-xilinx.c
> @@ -2071,8 +2071,8 @@ static int xudc_probe(struct platform_device *pdev)
>  	/* Map the registers */
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	udc->addr = devm_ioremap_resource(&pdev->dev, res);
> -	if (!udc->addr)
> -		return -ENOMEM;
> +	if (IS_ERR(udc->addr))
> +		return PTR_ERR(udc->addr);
>  
>  	irq = platform_get_irq(pdev, 0);
>  	if (irq < 0) {
> 

Reviewed-by: Michal Simek <michal.simek@xxxxxxxxxx>

Thanks,
Michal

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux