Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754489AbbKCNCE (ORCPT ); Tue, 3 Nov 2015 08:02:04 -0500 Received: from mailout2.samsung.com ([203.254.224.25]:50137 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753786AbbKCMyc (ORCPT ); Tue, 3 Nov 2015 07:54:32 -0500 X-AuditID: cbfee61b-f79d56d0000048c5-70-5638ae863e81 From: Robert Baldyga To: balbi@ti.com Cc: gregkh@linuxfoundation.org, andrzej.p@samsung.com, m.szyprowski@samsung.com, b.zolnierkie@samsung.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Baldyga Subject: [PATCH 05/23] usb: gadget: configfs: fix error path Date: Tue, 03 Nov 2015 13:53:44 +0100 Message-id: <1446555242-3733-6-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> References: <1446555242-3733-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprCLMWRmVeSWpSXmKPExsVy+t9jQd32dRZhBkcnMFrMetnOYrFxxnpW i4P36y2aF69ns7i8aw6bxaJlrcwWa4/cZbd4cHgnuwOHx/65a9g9+rasYvQ4fmM7k8fnTXIB LFFcNimpOZllqUX6dglcGSvWtLMWvGWrmP7mDlsD40XWLkZODgkBE4l/s14yQdhiEhfurWcD sYUEZjFKvGrU7mLkArJ/MkrMffwMrIFNQEdiy/cJjCC2iICAxPoXl9hBipgFzjFKPLzTBpYQ FrCRODXpOQuIzSKgKnH9xUGwqbwCLhI/X35ghNgmJ3Hy2GSgoRwcnAKuEpfeKYOYQkAlx7fz TGDkXcDIsIpRIrUguaA4KT3XKC+1XK84Mbe4NC9dLzk/dxMjOKyeSe9gPLzL/RCjAAejEg/v giXmYUKsiWXFlbmHGCU4mJVEeHfPtQgT4k1JrKxKLcqPLyrNSS0+xCjNwaIkzqvvaRQmJJCe WJKanZpakFoEk2Xi4JRqYOT0s71V8Oj5tL9NKWZvdyte3Ngj4BQ4Uc21zSZVdsrCfT9Ujc0O Stx9lR1+MfbIga/Kf7do3gqfyriIg9P1ennCsdfnyrdu15t1Mb0j/lZWpFhNdblvnSvfvC// dAX4F5Vml0ZMOrqu+DGj+fs4tkkfm6rsf0kyBnN0C64TvJ3FrxBeXf5ERYmlOCPRUIu5qDgR AADeHE8nAgAA Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1096 Lines: 31 As usb_gstrings_attach() fail can happen when some USB functions are are already added to some configurations (in prevoius loop iterations), we should always call purge_configs_funcs() to be sure that failure is be handled properly. Signed-off-by: Robert Baldyga --- 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 294eb74..d2101d8 100644 --- a/drivers/usb/gadget/configfs.c +++ b/drivers/usb/gadget/configfs.c @@ -1411,7 +1411,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/