Re: [PATCH -next] usb: dwc2: pci: Fix error return code in dwc2_pci_probe()

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

 



On 3/28/2018 5:36 PM, Wei Yongjun wrote:
> Fix to return error code -ENOMEM from the alloc fail error handling
> case instead of 0, as done elsewhere in this function.
> 
> Fixes: ecd29dabb2ba ("usb: dwc2: pci: Handle error cleanup in probe")
> Signed-off-by: Wei Yongjun <weiyongjun1@xxxxxxxxxx>

Reviewed-by: Grigor Tovmasyan <tovmasya@xxxxxxxxxxxx>

> ---
>   drivers/usb/dwc2/pci.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/dwc2/pci.c b/drivers/usb/dwc2/pci.c
> index 7f21747..bea2e8e 100644
> --- a/drivers/usb/dwc2/pci.c
> +++ b/drivers/usb/dwc2/pci.c
> @@ -141,8 +141,10 @@ static int dwc2_pci_probe(struct pci_dev *pci,
>   		goto err;
>   
>   	glue = devm_kzalloc(dev, sizeof(*glue), GFP_KERNEL);
> -	if (!glue)
> +	if (!glue) {
> +		ret = -ENOMEM;
>   		goto err;
> +	}
>   
>   	ret = platform_device_add(dwc2);
>   	if (ret) {
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-usb" in
> the body of a message to majordomo@xxxxxxxxxxxxxxx
> More majordomo info at  https://urldefense.proofpoint.com/v2/url?u=http-3A__vger.kernel.org_majordomo-2Dinfo.html&d=DwICAw&c=DPL6_X_6JkXFx7AXWqB0tg&r=K1ULVL1slpLXpMJJlAXSOxws4tRq0IkTBqxDkyW2hUQ&m=6vLEHiNG2gKkx9F-l1Yy77Kde75g7qA8Aw3fKXaQgCI&s=rFkdkzcIhy-tbIL8_skjqNXbFvj1Iolbh9CZ4-LNt4U&e=
> 

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



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux