From patchwork Fri Mar 18 02:24:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julian Calaby X-Patchwork-Id: 8615831 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B632CC0553 for ; Fri, 18 Mar 2016 02:25:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D840B20306 for ; Fri, 18 Mar 2016 02:25:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 147BF202FE for ; Fri, 18 Mar 2016 02:25:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752640AbcCRCZA (ORCPT ); Thu, 17 Mar 2016 22:25:00 -0400 Received: from mail-pf0-f180.google.com ([209.85.192.180]:34898 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751361AbcCRCY6 (ORCPT ); Thu, 17 Mar 2016 22:24:58 -0400 Received: by mail-pf0-f180.google.com with SMTP id n5so145969685pfn.2 for ; Thu, 17 Mar 2016 19:24:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=z5ntwgVvb9lBZ1zMInbGE6/sz0ROoEsle7XjycdeO94=; b=uVj3RxtlB+wQ8KVvF3LBNEDq7qPiC0MCKaqezeraV0gk+hlcfNTP9acLaUd44+OC9Q dKPH8fflkVN1CFQx9WQCRKAQhCjBbfnPRH72MkHs4oe9W2VmU3WGFEd1oxe7vYKFnRTU hpe65d3j2+4j6FHf4vGxTRnwoglTBtdteK5DqpnNHLx6t7fNXYn5D3Nyq8dUHn9zTkDR kJCtn4g7mQDbiY+QTuFB2/TB4TPwT/r7m4i9Ds+a/ZaBjuiH93bLxXJbuHwB3rDquD9B OhJCc7UQpZTSo8P5tysxdwu7+Apza596v/7eZnGo0kawcrtPmcgFRjWWYVOw3O7Xm/pq Y+GQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=z5ntwgVvb9lBZ1zMInbGE6/sz0ROoEsle7XjycdeO94=; b=LptaYJVNtq8yM6+nNhLB7ZOJU2kuo1N9RB24EujtHZIIgsiVWMYjT4LaIN4zE3h74E dRoOUTPnYRWou/dO77HDK/gTLGXqVMoqOiu4hMGgIDFvWcpmrqz5hMaYDhjrqngOQ3gI zlh7ADcNvV0ZVcXCPRed1Ix50qJncx4TfaykDPHCAO8SWYzQJqfiZJDaCodgVx5Ps8GR d6ggqYediU8V5u9K24izzUats4ooPFPtCjGR/PQ7ACLuR0tkZb8ZimKpTzug9t+Ya3ID GW0mlRAz4A8y1GQeMq44lafhtw7tKeK/mo8kgiAcpsHqDlKHp6VRaHb32se5hWHPvBMm qz+A== X-Gm-Message-State: AD7BkJI9YUlqtbDs3joLzXZCJnhSWHyJx/p2Ba9MI2+OMtas75cwJIMfJkgnjbrn4gE6kw== X-Received: by 10.66.233.131 with SMTP id tw3mr20090460pac.89.1458267898080; Thu, 17 Mar 2016 19:24:58 -0700 (PDT) Received: from multimedia.lan (C-59-101-14-180.hay.connect.net.au. [59.101.14.180]) by smtp.gmail.com with ESMTPSA id p74sm16402127pfa.11.2016.03.17.19.24.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 19:24:57 -0700 (PDT) From: Julian Calaby To: Kalle Valo Cc: Jia-Ju Bai , Larry Finger , Johannes Berg , linux-wireless@vger.kernel.org Subject: [PATCH 11/19] rtl818x_pci: Disable pci device in error handling code Date: Fri, 18 Mar 2016 13:24:51 +1100 Message-Id: X-Mailer: git-send-email 2.7.0 In-Reply-To: References: Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jia-Ju Bai When pci_request_regions in rtl8180_probe fails, pci_disable_device is not called to disable the device which is enabled by pci_enbale_device. This patch fixes the problem by adding a new lable in error handling code. Signed-off-by: Jia-Ju Bai Acked-by: Andrea Merello Signed-off-by: Julian Calaby --- drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c index a43a16f..c76af5d 100644 --- a/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c +++ b/drivers/net/wireless/realtek/rtl818x/rtl8180/dev.c @@ -1736,7 +1736,7 @@ static int rtl8180_probe(struct pci_dev *pdev, if (err) { printk(KERN_ERR "%s (rtl8180): Cannot obtain PCI resources\n", pci_name(pdev)); - return err; + goto err_disable_dev; } io_addr = pci_resource_start(pdev, 0); @@ -1938,6 +1938,8 @@ static int rtl8180_probe(struct pci_dev *pdev, err_free_reg: pci_release_regions(pdev); + + err_disable_dev: pci_disable_device(pdev); return err; }