From patchwork Sat Jan 16 13:02:58 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jia-Ju Bai X-Patchwork-Id: 8049011 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 EA45FBEEE5 for ; Sat, 16 Jan 2016 13:03:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 311C42034C for ; Sat, 16 Jan 2016 13:03:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 338F520328 for ; Sat, 16 Jan 2016 13:03:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751651AbcAPNDm (ORCPT ); Sat, 16 Jan 2016 08:03:42 -0500 Received: from m12-11.163.com ([220.181.12.11]:42788 "EHLO m12-11.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751050AbcAPNDl (ORCPT ); Sat, 16 Jan 2016 08:03:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=nm8/bx19p2CVVMFtf+ pa6ugxeClOJhjKwyEjyRua7uw=; b=POc2407WSkgpKjYGUpvE8LJTlt5Ok9XOUk udR11oqCUQE9y8bjGqZE92zSGHcx9jAT0KH31Z3cVaKgzbyFkSQ0x6tURWhM0xli TUPAjluMns0T2dqRWvN5+/AGhhG9JyqIeuaK1utEcuPRBIYgd9DDpIpfrqCmeTBJ aL6GWeqTM= Received: from bai-oslab.tsinghua.edu.cn (unknown [166.111.70.23]) by smtp7 (Coremail) with SMTP id C8CowAA3PwddP5pWjjAtAQ--.40540S2; Sat, 16 Jan 2016 21:02:25 +0800 (CST) From: Jia-Ju Bai To: andrea.merello@gmail.com, Larry.Finger@lwfinger.net, flamingice@sourmilk.net, kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Jia-Ju Bai Subject: [PATCH] rtl818x_pci: Disable pci device in error handling code Date: Sat, 16 Jan 2016 21:02:58 +0800 Message-Id: <1452949379-16052-1-git-send-email-baijiaju1990@163.com> X-Mailer: git-send-email 1.7.9.5 X-CM-TRANSID: C8CowAA3PwddP5pWjjAtAQ--.40540S2 X-Coremail-Antispam: 1Uf129KBjvdXoWruF1DZrWkZFyUAw47WrWDCFg_yoWkCrb_uF y0va97XFyrArnakr45Cry5AFZ09F1qqF48Wrs2qFyxurW5ZFZ8urWYvrn8Aa4UWF40kFy5 t34DXryrJayq9jkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUbOVyDUUUUU== X-Originating-IP: [166.111.70.23] X-CM-SenderInfo: xedlyx5dmximizq6il2tof0z/1tbipQLxelUL9YVxGAAAsr 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_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 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 --- 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; }