Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755461AbbLKLio (ORCPT ); Fri, 11 Dec 2015 06:38:44 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:49562 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755033AbbLKLZq (ORCPT ); Fri, 11 Dec 2015 06:25:46 -0500 X-AuditID: cbfee61a-f79266d000003652-c3-566ab2b9d95d 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 v3 05/36] usb: gadget: configfs: fix error path Date: Fri, 11 Dec 2015 12:24:44 +0100 Message-id: <1449833115-24065-6-git-send-email-r.baldyga@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1449833115-24065-1-git-send-email-r.baldyga@samsung.com> References: <1449833115-24065-1-git-send-email-r.baldyga@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprKLMWRmVeSWpSXmKPExsVy+t9jQd2dm7LCDHZPEbCY9bKdxWLjjPWs Fgfv11s0L17PZnF51xw2i0XLWpkt1h65y27x4PBOdgcOj/1z17B79G1Zxehx/MZ2Jo/Pm+QC WKK4bFJSczLLUov07RK4Mr5+XMJc8IGt4uimSSwNjFdYuxg5OSQETCQ+dD6HssUkLtxbzwZi CwnMYpRYfoSzi5ELyP7JKPHk2TQmkASbgI7Elu8TGEFsEQEBifUvLrGDFDELnGOUeHinDSwh LGAv8a17LZDNwcEioCqxa3MISJhXwFXiy/lJbBDL5CROHpsMtphTwE1i8slLzBCLXSXevF7H OIGRdwEjwypGidSC5ILipPRcw7zUcr3ixNzi0rx0veT83E2M4MB6JrWD8eAu90OMAhyMSjy8 CziywoRYE8uKK3MPMUpwMCuJ8P7aABTiTUmsrEotyo8vKs1JLT7EKM3BoiTOW3spMkxIID2x JDU7NbUgtQgmy8TBKdXA2NA6y8wj94zlYvtGP3YLg1sLeHa8O+HA9El726/c7VH5AZFSvE8z Fa81LVqkqBvw+VNHxc7goMOTnxc0HeBo0J+q28BzKs/rzOem7Fmle7ibllXdMG9IENq4uFnB z9X1lW5f9uowX9aNHoFRNpsevgt6NS97kbUMr9Vcz/Z/b304rHqNjz1RYinOSDTUYi4qTgQA X8kcVSgCAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1099 Lines: 31 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 --- 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/