Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp5317626rwb; Mon, 14 Nov 2022 02:47:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf5Bdp2xGQ6z800EPM37i0KD7wv2TIJ4CNsLSyh36hupAw5OTvGiL2cngVvlQGw9BZdAjTpB X-Received: by 2002:a17:906:2852:b0:7ad:9f03:fd44 with SMTP id s18-20020a170906285200b007ad9f03fd44mr9759815ejc.73.1668422864074; Mon, 14 Nov 2022 02:47:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668422864; cv=none; d=google.com; s=arc-20160816; b=vLsVUwD73fCcfIdWCU3Fit3NtNzDKamj0LhQfypeMblyLaCHOFscY8Y5Yk34Supfuu FjumuVbvxS5Hbw4cpJ1Tlz6ZwPn/k1hEEgeKFwIYJ7YF/Gxuydkq0WWHaXMfucgJsYvm Sj/ddN8bv7oZsEpoFnWANVJX6IYVwwj2UHDQQ15QxjgEPjgDFpbaNrARgRnJA4hc/qJm 4aVfi6dd0Rjw8NslhINf8DpfscsfgcP4+pBpzOvxYuPbJeU4KrQ/5IkYxe6WW2PR2+js aRlEBohln1LhJCjxhlBMaW9TYdjxuR7d8CZRtb1bnAoM5STetcDEmThWRLEarWVwNIv+ Gh+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=6KdgU7iyWUZ3cxQhY7doqJCFcr9J8JlYhEEQcVL1k6A=; b=Y0TqnFkQWyY6XsxCsWDbDVCXRji1/XJGGaf1y6CqasyJ5bkNFtJAgjWPnTOvoGqk8r WbnhpE9NggUGdpZH4eJ049NBhcZJfOma5B0I+scBf564Za56sHHiLpfpSb4+0fBXQSiO qS3nn/an9yTcWvn+BnJ1mYb9wCoFoTbHk0xyaZ3RrPEKf2xeK9bE0BZM4sU+3AcEkmXf mBEZ6s2TmZ1N4qzc8tSpKqMH0qgI7lCZOcvDxRgbb3YIEg9xHZVX9dwvhH+vLIdQR/5o sdC0yXVSi0ihHzYA+L4EYxug3fmh8WedPNZ3Vv9xxRSA4fRg3Rd1SV082YF05I/KYbuu 0gGg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bt8-20020a0564020a4800b0044ebf99d6f9si7549603edb.263.2022.11.14.02.47.22; Mon, 14 Nov 2022 02:47:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236253AbiKNJ3M (ORCPT + 88 others); Mon, 14 Nov 2022 04:29:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235933AbiKNJ3J (ORCPT ); Mon, 14 Nov 2022 04:29:09 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A34A47658; Mon, 14 Nov 2022 01:29:08 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4N9kWn2DNrzHw3N; Mon, 14 Nov 2022 17:28:37 +0800 (CST) Received: from kwepemm600005.china.huawei.com (7.193.23.191) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 17:28:51 +0800 Received: from ubuntu1804.huawei.com (10.67.175.30) by kwepemm600005.china.huawei.com (7.193.23.191) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Mon, 14 Nov 2022 17:28:51 +0800 From: Hui Tang To: , , CC: , , Subject: [PATCH] i2c-pxa2xx: fix missing pci_disable_device() on error in ce4100_i2c_probe Date: Mon, 14 Nov 2022 17:25:40 +0800 Message-ID: <20221114092540.247891-1-tanghui20@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.175.30] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemm600005.china.huawei.com (7.193.23.191) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Using pcim_enable_device() to avoid missing pci_disable_device(). Fixes: 7e94dd154e934 ("i2c-pxa2xx: Add PCI support for PXA I2C controller") Signed-off-by: Hui Tang --- drivers/i2c/busses/i2c-pxa-pci.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/i2c/busses/i2c-pxa-pci.c b/drivers/i2c/busses/i2c-pxa-pci.c index f614cade432b..30e38bc8b6db 100644 --- a/drivers/i2c/busses/i2c-pxa-pci.c +++ b/drivers/i2c/busses/i2c-pxa-pci.c @@ -105,7 +105,7 @@ static int ce4100_i2c_probe(struct pci_dev *dev, int i; struct ce4100_devices *sds; - ret = pci_enable_device_mem(dev); + ret = pcim_enable_device(dev); if (ret) return ret; @@ -114,10 +114,8 @@ static int ce4100_i2c_probe(struct pci_dev *dev, return -EINVAL; } sds = kzalloc(sizeof(*sds), GFP_KERNEL); - if (!sds) { - ret = -ENOMEM; - goto err_mem; - } + if (!sds) + return -ENOMEM; for (i = 0; i < ARRAY_SIZE(sds->pdev); i++) { sds->pdev[i] = add_i2c_device(dev, i); @@ -133,8 +131,6 @@ static int ce4100_i2c_probe(struct pci_dev *dev, err_dev_add: kfree(sds); -err_mem: - pci_disable_device(dev); return ret; } -- 2.17.1