Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753858Ab3EOVw0 (ORCPT ); Wed, 15 May 2013 17:52:26 -0400 Received: from mail-ie0-f170.google.com ([209.85.223.170]:58171 "EHLO mail-ie0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751418Ab3EOVwY (ORCPT ); Wed, 15 May 2013 17:52:24 -0400 MIME-Version: 1.0 In-Reply-To: <1368653557.9603.21.camel@pasglop> References: <1368461313-4371-1-git-send-email-jiang.liu@huawei.com> <1368461313-4371-4-git-send-email-jiang.liu@huawei.com> <5191F53E.4000305@cn.fujitsu.com> <51925136.5050302@gmail.com> <51926CF6.1050706@gmail.com> <51939E16.9090105@gmail.com> <51939FB1.20203@gmail.com> <1368653557.9603.21.camel@pasglop> Date: Wed, 15 May 2013 14:52:23 -0700 X-Google-Sender-Auth: 0RBGTe8AAiOykc9ZfE9z73LTLzk Message-ID: Subject: Re: [PATCH v2, part 1 3/9] PCI: Convert alloc_pci_dev(void) to pci_alloc_dev(bus) instead From: Yinghai Lu To: Benjamin Herrenschmidt Cc: Liu Jiang , "Rafael J . Wysocki" , linuxppc-dev@lists.ozlabs.org, "sparclinux@vger.kernel.org" , "David S. Miller" , Gu Zheng , Bjorn Helgaas , Greg Kroah-Hartman , Myron Stowe , "linux-pci@vger.kernel.org" , Linux Kernel Mailing List , Paul Mackerras Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1347 Lines: 47 On Wed, May 15, 2013 at 2:32 PM, Benjamin Herrenschmidt wrote: > On Wed, 2013-05-15 at 07:58 -0700, Yinghai Lu wrote: > >> Ben, >> >> in drivers/pci/probe.c::pci_scan_device() there is >> >> pci_set_of_node(dev); >> >> if (pci_setup_device(dev)) { >> kfree(dev); >> return NULL; >> } >> >> so if pci_setup_device fails, there is one dev reference is not release. >> >> please check you can just move down pci_set_of_node down after that >> failing path, like >> >> >> if (pci_setup_device(dev)) { >> kfree(dev); >> return NULL; >> } >> >> pci_set_of_node(dev); > > No, we want the OF node set when we run the quirks, we intentionally do > that early, the right thing to do is to to call pci_release_of_node() > in the error path (it's safe to call even if the node is NULL). > Good. We have two options. 1. can you please submit one complete patch, and get it merged into v3.10. 2. put it together with pci_alloc_dev patchset towards to v3.11? Thanks Yinghai -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/