Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754653AbbHXVmA (ORCPT ); Mon, 24 Aug 2015 17:42:00 -0400 Received: from v094114.home.net.pl ([79.96.170.134]:44801 "HELO v094114.home.net.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751386AbbHXVl6 (ORCPT ); Mon, 24 Aug 2015 17:41:58 -0400 From: "Rafael J. Wysocki" To: Yinghai Lu Cc: Bjorn Helgaas , David Miller , Benjamin Herrenschmidt , Wei Yang , TJ , Yijing Wang , Andrew Morton , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Len Brown , linux-acpi@vger.kernel.org Subject: Re: [PATCH v4 13/52] PCI, acpiphp: Add missing realloc list checking after resource allocation Date: Tue, 25 Aug 2015 00:09:29 +0200 Message-ID: <205780224.0d92UNafyF@vostro.rjw.lan> User-Agent: KMail/4.11.5 (Linux/4.1.0-rc5+; KDE/4.11.5; x86_64; ; ) In-Reply-To: <1440138067-4314-14-git-send-email-yinghai@kernel.org> References: <1440138067-4314-1-git-send-email-yinghai@kernel.org> <1440138067-4314-14-git-send-email-yinghai@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1358 Lines: 41 On Thursday, August 20, 2015 11:20:28 PM Yinghai Lu wrote: > We check the realloc list, as list must be empty after allocation. > > Add missing one acpiphp driver. > > Signed-off-by: Yinghai Lu > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: linux-acpi@vger.kernel.org > --- > drivers/pci/hotplug/acpiphp_glue.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/pci/hotplug/acpiphp_glue.c b/drivers/pci/hotplug/acpiphp_glue.c > index ff53856..1c7c1d7 100644 > --- a/drivers/pci/hotplug/acpiphp_glue.c > +++ b/drivers/pci/hotplug/acpiphp_glue.c > @@ -507,6 +507,7 @@ static void enable_slot(struct acpiphp_slot *slot) > } > } > __pci_bus_assign_resources(bus, &add_list, NULL); > + BUG_ON(!list_empty(&add_list)); Is crashing the kernel the best we can do here? What about bailing out with a WARN_ON() instead? Surely, the kernel can work without the new device? > > acpiphp_sanitize_bus(bus); > pcie_bus_configure_settings(bus); > -- I speak only for myself. Rafael J. Wysocki, Intel Open Source Technology Center. -- 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/