Received: by 10.192.165.148 with SMTP id m20csp2467795imm; Sun, 22 Apr 2018 07:39:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+dQyVu3s1J83s+B7r5agcFb1gyBAbSMFMD78rADUbw07oAmBnjyqDgW6tq5SAnQYtkoT2q X-Received: by 10.99.150.18 with SMTP id c18mr14393688pge.361.1524407982195; Sun, 22 Apr 2018 07:39:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524407982; cv=none; d=google.com; s=arc-20160816; b=PM8dO/Ehal43OOYGB0xUFQ47QEPSHqhIGrb14FTE8153ia2CR71ZCm1IihgUlyOa9o 5IYi8+4KYmBatPrbRfwpfSuUfMQpGosx7eYTdg/u8rfDSoG5lChKB8eiLuY70LF2Hf9Z fZ64KVud/zzHeuk9snlb1OcRUrd6GxkAlchbRt4yegh2fS9lJL+AluUUALPiWfEZCXxN TQAkUsK3RFKXy81znnilZdYhNUknjHgKai4GHi4zPSPRxb7idi89oAOE/3cysmTNH5wX vwmGGVjMqSLx8lDNY6jYD1iDhcj0zjgBOXlKnaNWr5GXUfrEx0L/DptFO1vHE2E82pa5 F8mw== 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=lfG+RacQBLUxbaS9cXZvPo9u4jttmcZr1h7FATCGn0Q=; b=glv9eSiD1O3ve2YoW04ywT3NklO+j5HJFAq0517gF6AuQDyYMQfT36Pu0DtDoZ35EV NZq7eVjnPNPqd6B4P0wUakYcJyB1xVWdtNRxX2sj41YEDs0RCMjBcB4hGlAtSHf2mkU8 6H10+ubZsKek57OD7A9xYzLw/3NCa9nYjxPjvKZVzZ79aahjM4trqwY4qy3Ht7ZPwYJ7 reM1aOL2r6/r/MkjEQV2ynTNGaLso9m6tNX9V+emySWJI4ob6HDO/BsLKzNmqCxFE1p5 1dN3m6gjaqQwzHMKP/Htc2P7V4yDeWpeNb52Zb7MgVpuv5oRnf10DyiyvZEu9A1lFt3M 5Brg== 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 c24-v6si10219625plo.113.2018.04.22.07.39.28; Sun, 22 Apr 2018 07:39:42 -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 S1757396AbeDVOi1 (ORCPT + 99 others); Sun, 22 Apr 2018 10:38:27 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:58920 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757251AbeDVOS0 (ORCPT ); Sun, 22 Apr 2018 10:18:26 -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 DED4BCFF; Sun, 22 Apr 2018 14:18:24 +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.4 38/97] usb: dwc3: pci: Properly cleanup resource Date: Sun, 22 Apr 2018 15:53:16 +0200 Message-Id: <20180422135307.458166318@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135304.577223025@linuxfoundation.org> References: <20180422135304.577223025@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.4-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 @@ -167,7 +167,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; } pci_set_drvdata(pci, dwc3);