Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1278739

[PATCH v2 04/29] usb: gadget: configfs: fix error path

From Robert Baldyga <r.baldyga@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v2 04/29] usb: gadget: configfs: fix error path
Date 2015-11-27 12:10 +0100
Message-ID <qzp4E-243-63@gated-at.bofh.it> (permalink)
References <qzp4B-243-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


As usb_gstrings_attach() failure can happen when some USB functions are
are already added to some configurations (in previous loop iterations),
we should always call purge_configs_funcs() to be sure that failure is
be handled properly.

Signed-off-by: Robert Baldyga <r.baldyga@samsung.com>
---
 drivers/usb/gadget/configfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
index 163d305..0557f80 100644
--- a/drivers/usb/gadget/configfs.c
+++ b/drivers/usb/gadget/configfs.c
@@ -1342,7 +1342,7 @@ static int configfs_composite_bind(struct usb_gadget *gadget,
 			s = usb_gstrings_attach(&gi->cdev, cfg->gstrings, 1);
 			if (IS_ERR(s)) {
 				ret = PTR_ERR(s);
-				goto err_comp_cleanup;
+				goto err_purge_funcs;
 			}
 			c->iConfiguration = s[0].id;
 		}
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/29] usb: gadget: composite: introduce new function API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 04/29] usb: gadget: configfs: fix error path Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 24/29] usb: gadget: f_hid: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 05/29] usb: gadget: composite: introduce new descriptors  format Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 02/29] usb: gadget: f_sourcesink: free requests in  sourcesink_disable() Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 26/29] usb: gadget: f_eem: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 20/29] usb: gadget: f_sourcesink: convert to new API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 08/29] usb: gadget: composite: handle function bind Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 29/29] usb: gadget: f_serial: conversion to new API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100
  [PATCH v2 19/29] usb: gadget: f_loopback: convert to new API Robert Baldyga <r.baldyga@samsung.com> - 2015-11-27 12:10 +0100

csiph-web