Received: by 10.192.165.148 with SMTP id m20csp2488944imm; Sun, 22 Apr 2018 08:05:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx48GCxmgl+h4MQL9nNsNQ6pJa3z8uKsbQAsCOhr0RnopYVpvSkmWSfV4cfKzP7SnjCznHf6N X-Received: by 10.101.77.199 with SMTP id q7mr14680840pgt.305.1524409508001; Sun, 22 Apr 2018 08:05:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524409507; cv=none; d=google.com; s=arc-20160816; b=EPAuZZwUJwiBAjb7eUPQnyy0G6C2IVJG9hk+t008w2WPQUWsFzOqPyPbUO7FTqtbL5 9XaId5M2Gl0TPF96LiYYVlFhgnfADyLh1jgUU9IZHNILxMCcSY265J9p7mLvUmITFaLK hd3Sw9lyj1688s9T/HAM29T0cudIVX3LaGnL+2kVvjFERJZSPAqsPrePywxSXDanT1wx 7kQyU4T7OLPPsCm/l6mTMOLeI34VWcR2zzbMUdOSMQYwHYJIQPt7JW4BB3tiaAd7zDNj 1ucvHVBu+/pAJPUPoZtazQGMu12z8D6RyIfuDld/wzf9Mfn4KyWnmd76peUCU9QYYkPt zxiQ== 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=6vY+OUyRLl03VdkKhGg2gxoHu5FM1Ftzbz3eyDMF7as=; b=SAay8h0kEumjc4ecnVsjuN3fqc59b+Qf4pHJAKE4Scc17ejAE76UtR17qiZH8ndMg9 vEAMufeAI00q/XaXbW894c3/2HMn1Lqbt/+QuuDDCqtaDbFjZkjltI0V3lLQ5+GEgAA7 xj6UhqcjWkCdL29SfGOCgiLoaKvFgSus7mIxDWfXGu5opbiKI/DFdnn6OowFrczC2mSd a/tYmoBb8jGrNHrW/QK3+8vzvGek05UnLELRYKmslSuiM3p/K98UMvzUFDCLmLjm3Sz6 OEiM1ItVm9q38HVBpoLL7tcJeSxiU3UoHRzUXZSXyCWOJeB9GviAxPMQPE5mgOZtCMbX 6Imw== 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 h2si7634946pgq.604.2018.04.22.08.04.53; Sun, 22 Apr 2018 08:05:07 -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 S1756629AbeDVOMH (ORCPT + 99 others); Sun, 22 Apr 2018 10:12:07 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54808 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756037AbeDVOME (ORCPT ); Sun, 22 Apr 2018 10:12:04 -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 1B255CB0; Sun, 22 Apr 2018 14:12:03 +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 4.9 22/95] usb: dwc3: pci: Properly cleanup resource Date: Sun, 22 Apr 2018 15:52:51 +0200 Message-Id: <20180422135211.349345810@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135210.432103639@linuxfoundation.org> References: <20180422135210.432103639@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 4.9-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 @@ -173,7 +173,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 err; } dwc3->dev.parent = dev;