On 10/24/2012 12:25 PM, Sergei Shtylyov wrote:
Hello.

Hi,

On 23-10-2012 0:14, Sebastian Andrzej Siewior wrote:

In case something goes wrong here, don't leak memory / endpoints.

Cc: jassisinghb...@gmail.com
Signed-off-by: Sebastian Andrzej Siewior <bige...@linutronix.de>
---
drivers/usb/gadget/f_uac2.c | 25 ++++++++++++++++++++++---
1 file changed, 22 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/f_uac2.c b/drivers/usb/gadget/f_uac2.c
index d3c6cff..f02b8ec 100644
--- a/drivers/usb/gadget/f_uac2.c
+++ b/drivers/usb/gadget/f_uac2.c
[...]
@@ -1014,9 +1019,23 @@ afunc_bind(struct usb_configuration *cfg,
struct usb_function *fn)
prm->max_psize = 0;
dev_err(&uac2->pdev.dev,
"%s:%d Error!\n", __func__, __LINE__);
+ goto err;
}

- return alsa_uac2_init(agdev);
+ ret = alsa_uac2_init(agdev);
+ if (ret)
+ goto err;
+ return 0;

if (!ret)
return 0;

would be slightly less code.

Yes, slightly. You lose the "if (err) goto err" which confuses me
sometimes and if you add extra code past that statement you have to
revert that piece.

+err:

WBR, Sergei

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

Reply via email to