Re: PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed.

From: Matthew Wilcox
Date: Fri Apr 01 2005 - 20:11:49 EST


On Fri, Apr 01, 2005 at 03:47:50PM -0800, Greg KH wrote:
> PCI: fix an oops in some pci devices on hotplug remove when their resources are being freed.
>
> As reported by Prarit Bhargava <prarit@xxxxxxx>
> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>
>
> diff -Nru a/drivers/pci/remove.c b/drivers/pci/remove.c
> for (i = 0; i < PCI_NUM_RESOURCES; i++) {
> struct resource *res = dev->resource + i;
> - if (res->parent)
> + if (res && res->parent)
> release_resource(res);

I can't believe this fixes anything. How can res possibly be NULL here?
It's a pointer into a pci_dev.

--
"Next the statesmen will invent cheap lies, putting the blame upon
the nation that is attacked, and every man will be glad of those
conscience-soothing falsities, and will diligently study them, and refuse
to examine any refutations of them; and thus he will by and by convince
himself that the war is just, and will thank God for the better sleep
he enjoys after this process of grotesque self-deception." -- Mark Twain
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/