# Re: \[PATCH 1/2\] gnss: add USB support

- From: Johan Hovold \<johan@kernel.org\>
- Date: 2021-12-20 13:25:47 
- List: linux-usb
- Page: https://ratatoskr.run/linux-usb/2021/12/1613908
- Thread: https://ratatoskr.run/linux-usb/2021/12/1613791/t.md

```text
On Mon, Dec 20, 2021 at 01:49:23PM +0100, Oliver Neukum wrote:
> 
> On 20.12.21 12:19, Johan Hovold wrote:
> > +static int gnss_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)

> > +	urb = usb_alloc_urb(0, GFP_KERNEL);
> > +	if (!urb)
> > +			goto err_put_gdev;
> 
> The value of 'ret' here is the result of
> usb_find_common_endpoints(), hence 0 due to the prior test.

> > +err_free_buf:
> > +	kfree(buf);
> > +err_free_urb:
> > +	usb_free_urb(urb);
> > +err_put_gdev:
> > +	gnss_put_device(gdev);
> > +err_free_gusb:
> > +	kfree(gusb);
> > +
> > +	return ret;
> Yet you return it in the error case and subsequent error cases..

Thanks for spotting that! I'll fix it up before applying.

Johan
```
