Thread (9 messages) 9 messages, 4 authors, 2021-12-22

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

From: Johan Hovold <johan@kernel.org>
Date: 2021-12-20 13:25:47
Also in: lkml

On Mon, Dec 20, 2021 at 01:49:23PM +0100, Oliver Neukum wrote:
On 20.12.21 12:19, Johan Hovold wrote:
quoted
+static int gnss_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
quoted
+	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.
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help