Received: by 10.192.165.148 with SMTP id m20csp2453126imm; Sun, 22 Apr 2018 07:21:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49r2aoWtYjfX+ulwI1wFOSBvAfHbp9T4wNNeLv+iNE4IKJXYYYrD73PQhZhDqN8mkv1LTnt X-Received: by 2002:a17:902:2a43:: with SMTP id i61-v6mr17865495plb.54.1524406901314; Sun, 22 Apr 2018 07:21:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524406901; cv=none; d=google.com; s=arc-20160816; b=v5Zl1rSLignxksR0OpSnsckd8U4Vngxae51pYgfBN/ocyqwkxrIxE8ZYOS3tH9vLjW Gpei6A2xulKVAk22hAgNoeOaN7+V2AhVjfBCSFRhbBfEDO++awdis6Otgyau/kPI9TOg Ac4XlHeHz9JcjkYgY8Cxp9mZV7h0dhGX1S2STusO9vPToplwHdllGz9vPf1ZOsk/USJS v1wJwy2FcKXYdRZypwfYXzC7/pme6s1GzufY6Jlc0Yh+OrbsE547KjWn01jsS4flyDjp y3nJk8SEUnhU+inJBLWVe8RDElS/2m7TcThfw1emE5HAtBOckFQjsqgo3cKOuZWtn+xA 2fGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Jj4pwqqKi8oAl0pDygXGsFFrpaAiQg7TYNBw006JOBU=; b=p2ZJRTcle2WEdZWEDCe2feNUn1F06oAoWqrha9eODkjcXmQdE0CLtsLZOxATZBCq+B xRJs/z2xZZM42M7D4LWu4ZrmN0G/+kjt1kavTP3H8vDyIerNf9pY8T3zt2btUyBdryJ+ hZWqGDr+B1c+YaskZzsjjx1SVO7R4xAnD/BQ1K+nqlUcGvFayresjcO51ByFTFO5kLln ErJ992JjuCrRnASiTxas4iKAASt/um5bXmnH17BMGLn6Y0poyeDo8mwfqRCCT/TpkytD CNmCPe0J32IKUyVMxGtL6mMVs3q1NiDERqBSi2GqCCOm4jQ/aM4RsCFtmMPk/RvSpY7/ IcFQ== 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 d2-v6si7420129plh.387.2018.04.22.07.21.27; Sun, 22 Apr 2018 07:21:41 -0700 (PDT) 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 S1757418AbeDVOUY (ORCPT + 99 others); Sun, 22 Apr 2018 10:20:24 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60374 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757377AbeDVOUV (ORCPT ); Sun, 22 Apr 2018 10:20:21 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 9D199486; Sun, 22 Apr 2018 14:20:20 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Thinh Nguyen , Felipe Balbi Subject: [PATCH 3.18 17/52] usb: dwc3: pci: Properly cleanup resource Date: Sun, 22 Apr 2018 15:53:50 +0200 Message-Id: <20180422135316.067084196@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135315.254787616@linuxfoundation.org> References: <20180422135315.254787616@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thinh Nguyen commit cabdf83dadfb3d83eec31e0f0638a92dbd716435 upstream. Platform device is allocated before adding resources. Make sure to properly cleanup on error case. Cc: Fixes: f1c7e7108109 ("usb: dwc3: convert to pcim_enable_device()") Signed-off-by: Thinh Nguyen Signed-off-by: Felipe Balbi Signed-off-by: Greg Kroah-Hartman --- drivers/usb/dwc3/dwc3-pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/dwc3/dwc3-pci.c +++ b/drivers/usb/dwc3/dwc3-pci.c @@ -143,7 +143,7 @@ static int dwc3_pci_probe(struct pci_dev ret = platform_device_add_resources(dwc3, res, ARRAY_SIZE(res)); if (ret) { dev_err(dev, "couldn't add resources to dwc3 device\n"); - return ret; + goto err3; } pci_set_drvdata(pci, glue);