patch "usb: gadget: f_uac2: fix error handling at afunc_bind" added to usb-testing
Subsystems (2)
This is a note to let you know that I've just added the patch titled
usb: gadget: f_uac2: fix error handling at afunc_bind
to my usb git tree which can be found at
git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git
in the usb-testing branch.
The patch will show up in the next release of the linux-next tree (usually sometime within the next 24 hours during the week.)
The patch will be merged to the usb-next branch sometime soon, after it passes testing, and the merge window is open.
If you have any questions about this process, please let me know.
Quoted 1 line
From
f1d3861d63a5d79b8968a02eea1dcb01bb684e62Mon Sep 17 00:00:00 2001
From: Peter Chen <[email protected]>
Date: Tue, 8 Nov 2016 10:10:44 +0800
Subject: usb: gadget: f_uac2: fix error handling at afunc_bind
The current error handling flow uses incorrect goto label, fix it
redundant usb_free_all_descriptors")
--- drivers/usb/gadget/function/f_uac2.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/gadget/function/f_uac2.c +7 -7
@@ -1067,13 +1067,13 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) agdev->out_ep =usb_ep_autoconfig (gadget, &fs_epout_desc);if (!agdev->out_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); - goto err; +return ret; } agdev->in_ep =usb_ep_autoconfig (gadget, &fs_epin_desc);if (!agdev->in_ep) {dev_err (dev,"%s:%d Error!\n" , __func__, __LINE__); - goto err; +return ret; } uac2->p_prm.uac2 = uac2;
@@ -1091,7 +1091,7 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) ret =usb_assign_descriptors (fn, fs_audio_desc, hs_audio_desc,NULL ,NULL );if (ret) - goto err; +return ret; prm = &agdev->uac2.c_prm; prm->max_psize = hs_epout_desc.wMaxPacketSize;
@@ -1106,19 +1106,19 @@ afunc_bind(struct usb_configuration *cfg, struct usb_function *fn) prm->rbuf =kzalloc (prm->max_psize *USB_XFERS ,GFP_KERNEL );if (!prm->rbuf) { prm->max_psize =0 ; - goto err_free_descs; + goto err; } ret =alsa_uac2_init (agdev);if (ret) - goto err_free_descs; + goto err;return 0 ; -err_free_descs: -usb_free_all_descriptors (fn); err:kfree (agdev->uac2.p_prm.rbuf);kfree (agdev->uac2.c_prm.rbuf); +err_free_descs: +usb_free_all_descriptors (fn);return -EINVAL ; }
Signature · 1 line
2.10.2