Received: by 10.192.165.148 with SMTP id m20csp2541283imm; Sun, 22 Apr 2018 09:10:43 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/tK1Lq5Pj23pJ3LiNvsPAc25DKDQJGm0B6S8PjAP/lLMSutzU2+GeFrUDrs093C5l3OdOT X-Received: by 2002:a17:902:8501:: with SMTP id bj1-v6mr17457354plb.239.1524413443372; Sun, 22 Apr 2018 09:10:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524413443; cv=none; d=google.com; s=arc-20160816; b=DmVLe0QJ7C9qMVmEq6NB7VdH1qZR36u1BBkoMKqIH3ykJNJZ14t12nloz4PtUZFIxc HAh2jNkv4N9YxUNMiZc9bXQvZMv4aw3MxFj1GA5oOfJ04F+7hbvkcRNxk/4zB07ZvDHh yODFXhlammYpbAKkCaphh7O7j6gb7erS9li8UOrhivXqolquonVaa9AIvm8BkdCufwQ9 wV/TYXTK19+MeQ5jzfhCOEbnnpsk/5w8AKaEX6Y5jR9dVpdBcJGvRJVTitFwYrTpkwNU w76IbHaKpzrgZikAkLSqaOOL+/fuXJdzcsBWQThMvienIIbs3R25Ngpy8AyRP8v5h8dt dwBw== 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=5dSA6AYvuDv1sp8X6AkdyDn1FVRWJtyY1npYD/hPrRI=; b=kRoR8drewXR7ewYWzlhu57CRRZvYZpZ3nAMRQM2SVc9cfW2kzMh7XC628EqgQ5592e blKPcsCPwHPpF3d6WvmSjkF8MlICMretvgbbcIJViiBGx7eVhNEodFnRMn/LlOtwPO9z A3km1VUJbMh0fSv/9oIp0lfD1U9VPlvaeIbj8Oj/jTyY6l3zsW6UsvZFdwjxIH2xkY7O nzHr2wTV6tYy1oWVOmMfncrBLRrR7QbTom2ocxHaPNt0yDcZ5oW/XEevKXHlRiWBSxdn ejxa8aZa7xw4vav1Ulse3QHgezc/BX9Mwy/ULVCy2tAyYJzDMBo2BkuWwLscT68V+K+p ys6A== 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 c10-v6si10274190pla.127.2018.04.22.09.10.29; Sun, 22 Apr 2018 09:10:43 -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 S1753971AbeDVQJZ (ORCPT + 99 others); Sun, 22 Apr 2018 12:09:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45238 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753798AbeDVN4e (ORCPT ); Sun, 22 Apr 2018 09:56:34 -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 0BD56C64; Sun, 22 Apr 2018 13:56:33 +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.16 043/196] usb: dwc3: pci: Properly cleanup resource Date: Sun, 22 Apr 2018 15:51:03 +0200 Message-Id: <20180422135106.302095614@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@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.16-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 @@ -222,7 +222,7 @@ static int dwc3_pci_probe(struct pci_dev ret = platform_device_add_resources(dwc->dwc3, res, ARRAY_SIZE(res)); if (ret) { dev_err(dev, "couldn't add resources to dwc3 device\n"); - return ret; + goto err; } dwc->pci = pci;