Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp2189505ybm; Thu, 23 May 2019 12:50:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqyDVMT9NP0vP2afHp2fqv8GZH5ObiMi9MnYcP0IWEoFHyfsZzzWWl6u5H05kztKC5RKHq/i X-Received: by 2002:a17:902:4623:: with SMTP id o32mr79536229pld.276.1558641046066; Thu, 23 May 2019 12:50:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558641046; cv=none; d=google.com; s=arc-20160816; b=lgQgW77x8P7pc9gIGyFeBydegVc+nTrazxNOY3CvCKy1UpkrQMH+J9Pkqbbvj78Ryd VAnDbB633tRLKbbmWSt9S1aqmPAgCG8Bqf13p+3BGJi6xCjvK7HzIHTtIKTJ7dLu1nB2 h1+PIExayk35G00SglB0Q/kYiHC3UIVVIQ1eVc9QekZgmW6vRgEf4n25Zb6IOZgnGRHH CJLEuuamEJolZ+9Awn5RYdKytRwf/FXwF501UuUwxTKmRdLTS3Ax/nRw99hz3VP7y5Gy //LpEGnaIRwYRPrW8QRwapy7+wgZUtetDMZmofRjrkDZBcgqpwF/1xjyengt1AdKZYsb /83g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=4cwYU/pMmIzBEYPuKIC7iOG8SXd0yiA78JCSAwnRYFA=; b=M49YNf0IYE8kD3assYPMDvYQcF5g4ddUHXMDe9dRDiqDby/Uh9J54KsypH31/aRxCb 6Fyale/KjLyuFWoh32ZAUkjxyCCrl/1nIbjajK3C+ukbsfvQLbOkDxiupXZz2Ha0Mdb9 C7v2Tqw4TPYyOtWd2jveJD3VAhajxdQO3jLoklwcNoegMczIWBcC+zjbz+kybAFix1xm lOZzfFCAhAvnVfURe6TPfxW9OjJNvkxPwtCpFSrpJN/SiLzpd+xeDUPOROnyHCx8Dp+4 teJuZx4LtZrPowe1qR/J9CCSKF/Nb+OxD0Snd4WeSGqiLdsLZ+jnEpTN/wUMaHdLoVFU SArg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A81Db+NS; 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 3si590420pgj.104.2019.05.23.12.50.30; Thu, 23 May 2019 12:50:46 -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; dkim=pass header.i=@kernel.org header.s=default header.b=A81Db+NS; 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 S2388290AbfEWTLt (ORCPT + 99 others); Thu, 23 May 2019 15:11:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:45324 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388268AbfEWTLs (ORCPT ); Thu, 23 May 2019 15:11:48 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F1C62184E; Thu, 23 May 2019 19:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558638707; bh=FtYbvIv3gOl5LAcrN+tt1XTYQKijAsSZSVhpgmTQNSA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=A81Db+NS+pEJudswf/t2J7YxkamVdGY9B3ucBrM2apapungm2S93sa8u10cDMb0te 3FhFNqlHjCC0smb/Da/82kIp6dJsTyK7qtHekVAyC5ImN2aJWT+h5jnPPeQZPBTCj3 X/++7eSZrTWo2T/XqalX/3F+UVu7N9B6YFbYv+ZU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Pan Bian , Christian Lamparter , Kalle Valo Subject: [PATCH 4.14 18/77] p54: drop device reference count if fails to enable device Date: Thu, 23 May 2019 21:05:36 +0200 Message-Id: <20190523181722.764588353@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190523181719.982121681@linuxfoundation.org> References: <20190523181719.982121681@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pan Bian commit 8149069db81853570a665f5e5648c0e526dc0e43 upstream. The function p54p_probe takes an extra reference count of the PCI device. However, the extra reference count is not dropped when it fails to enable the PCI device. This patch fixes the bug. Cc: stable@vger.kernel.org Signed-off-by: Pan Bian Acked-by: Christian Lamparter Signed-off-by: Kalle Valo Signed-off-by: Greg Kroah-Hartman --- drivers/net/wireless/intersil/p54/p54pci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/net/wireless/intersil/p54/p54pci.c +++ b/drivers/net/wireless/intersil/p54/p54pci.c @@ -554,7 +554,7 @@ static int p54p_probe(struct pci_dev *pd err = pci_enable_device(pdev); if (err) { dev_err(&pdev->dev, "Cannot enable new PCI device\n"); - return err; + goto err_put; } mem_addr = pci_resource_start(pdev, 0); @@ -639,6 +639,7 @@ static int p54p_probe(struct pci_dev *pd pci_release_regions(pdev); err_disable_dev: pci_disable_device(pdev); +err_put: pci_dev_put(pdev); return err; }