From patchwork Thu Jul 28 16:26:47 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Julia Lawall X-Patchwork-Id: 107278 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id AC1CAB6F57 for ; Fri, 29 Jul 2011 02:26:56 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755275Ab1G1Q0z (ORCPT ); Thu, 28 Jul 2011 12:26:55 -0400 Received: from mgw2.diku.dk ([130.225.96.92]:50290 "EHLO mgw2.diku.dk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755186Ab1G1Q0y (ORCPT ); Thu, 28 Jul 2011 12:26:54 -0400 Received: from localhost (localhost [127.0.0.1]) by mgw2.diku.dk (Postfix) with ESMTP id 65E2B19BC55; Thu, 28 Jul 2011 18:26:53 +0200 (CEST) Received: from mgw2.diku.dk ([127.0.0.1]) by localhost (mgw2.diku.dk [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 30431-11; Thu, 28 Jul 2011 18:26:48 +0200 (CEST) Received: from palace.topps.diku.dk (palace.ekstranet.diku.dk [192.38.115.202]) by mgw2.diku.dk (Postfix) with ESMTP id 0977519BC53; Thu, 28 Jul 2011 18:26:48 +0200 (CEST) From: Julia Lawall To: "David S. Miller" Cc: kernel-janitors@vger.kernel.org, linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] drivers/ide/cy82c693.c: Add missing pci_dev_put Date: Thu, 28 Jul 2011 18:26:47 +0200 Message-Id: <1311870407-22461-2-git-send-email-julia@diku.dk> X-Mailer: git-send-email 1.7.1 Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Julia Lawall Pci_get_slot calls pci_dev_get, so pci_dev_put is needed before leaving the function in the case where pci_get_slot is locally used. The semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // @@ local idexpression x; expression e; @@ *x = pci_get_slot(...) ... when != true x == NULL when != pci_dev_put(x) when != e = x when != if (x != NULL) {<+... pci_dev_put(x); ...+>} *return ...; // Signed-off-by: Julia Lawall --- Not tested. drivers/ide/cy82c693.c | 2 ++ 1 file changed, 2 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/ide/cy82c693.c b/drivers/ide/cy82c693.c index 3be60da..67cbcfa 100644 --- a/drivers/ide/cy82c693.c +++ b/drivers/ide/cy82c693.c @@ -141,6 +141,8 @@ static void cy82c693_set_pio_mode(ide_hwif_t *hwif, ide_drive_t *drive) pci_write_config_byte(dev, CY82_IDE_SLAVE_IOW, time_16); pci_write_config_byte(dev, CY82_IDE_SLAVE_8BIT, time_8); } + if (hwif->index > 0) + pci_dev_put(dev); } static void __devinit init_iops_cy82c693(ide_hwif_t *hwif)