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

Matthew Wilcox
2005-04-02T01:10:36Z

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@sgi.com>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> 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