Received: by 10.223.185.116 with SMTP id b49csp6355554wrg; Wed, 28 Feb 2018 08:05:16 -0800 (PST) X-Google-Smtp-Source: AG47ELv3mpvCL20j0KnTUI6ZXFuxNWhgPOSM8xGhIzBVl9yMBuurbgb9TNZveqpos7EqMSM4wxU2 X-Received: by 10.98.249.76 with SMTP id g12mr1311809pfm.76.1519833916356; Wed, 28 Feb 2018 08:05:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519833916; cv=none; d=google.com; s=arc-20160816; b=WJL6KHWa5N0/Dz8F0W4vvcrpTEN6iFCuBii7QqUCgK6pSfbsd9qVxy2TBH5AAb8kS0 kLMhAj3gJ5HXFC/nFOoytgpBEPYwJzkHWbqK+4ab1dglA5Eab3G5q9pjxQK/+X7PrmSf NN0sts+PgaDcsTkvXzVTOh9bmlAiZ8PL8keWY+RIJ4aofy3cSry7cCw/iUona/QmQrsP Y/THMWC85gDTEVcOariCfx40OhCCJF6fWXqkcMAc/GiKCkvl40bn5pUJpfIyQCb/8TEn G+JR4IJnXrIhzZ9lhBzyJm1MwaUifD6G9E+fNIk0+pE6Czq3y4PzvAbTEbplv7506tSe a1yA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=fRpbx7PvixszwGSjxHQLo0cPyXrfW+B11lbgwG5xd7Q=; b=Fugi4gma0XuFDrB/9ICiQNPtSn19Dt1mk6LLU2y4cTbPzJT0bL7zu4d+aW2sOUAGxG znOl+NFY2ID4dA3Dw9ICG13H8fiPoWAoVxLy8APLPzzWl4pVjeCHztolcN0r43/o+viK IE8x+UQy06zPKnnNSY5jQuJLnDDMEgg31yqHkNhCB/dA4C5BwIxV5CDu4T0staM5C0wC CwNSw4q7EXZl2nlW/vIY1gb09E38tlHBBlH/UKCUTBggQhz9QS/i2bApeW3ji4+hb3zh zD+F70PQ9EMIgh3q8jVT+OQwIlCkJdpcwqzFzwtnfPjhvgOUUh0n8qUTLcU20VV+89iv wEGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m2si1207512pgt.56.2018.02.28.08.05.00; Wed, 28 Feb 2018 08:05:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932656AbeB1QDF (ORCPT + 99 others); Wed, 28 Feb 2018 11:03:05 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:34737 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932224AbeB1QDB (ORCPT ); Wed, 28 Feb 2018 11:03:01 -0500 Received: from [2a02:8011:400e:2:6f00:88c8:c921:d332] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1er3Yq-0006Xe-Iy; Wed, 28 Feb 2018 15:22:28 +0000 Received: from ben by deadeye with local (Exim 4.90_1) (envelope-from ) id 1er3Yj-0000Ey-BU; Wed, 28 Feb 2018 15:22:21 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Alan Stern" , "Felipe Balbi" , "Peter Chen" Date: Wed, 28 Feb 2018 15:20:18 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 191/254] usb: udc: core: add device_del() call to error pathway In-Reply-To: X-SA-Exim-Connect-IP: 2a02:8011:400e:2:6f00:88c8:c921:d332 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.55-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Alan Stern commit c93e64e91248becd0edb8f01723dff9da890e2ab upstream. This patch fixes a bug in the error pathway of usb_add_gadget_udc_release() in udc-core.c. If the udc registration fails, the gadget registration is not fully undone; there's a put_device(&gadget->dev) call but no device_del(). Acked-by: Peter Chen Signed-off-by: Alan Stern Signed-off-by: Felipe Balbi [bwh: Backported to 3.16: adjust filename] Signed-off-by: Ben Hutchings --- drivers/usb/gadget/udc-core.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/usb/gadget/udc-core.c +++ b/drivers/usb/gadget/udc-core.c @@ -252,6 +252,7 @@ err4: err3: put_device(&udc->dev); + device_del(&gadget->dev); err2: put_device(&gadget->dev);