From: Andrew Morton It's scary passing a half-initialised `struct resource' into callees: we don't know what they might do. Let's make the other fields in there all-zeroes. Cc: Alan Cox Cc: Bartlomiej Zolnierkiewicz Cc: Greg KH Cc: Ralf Baechle Cc: Yoichi Yuasa Signed-off-by: Andrew Morton --- drivers/pci/probe.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff -puN drivers/pci/probe.c~fix-ide-legacy-mode-resources-fix drivers/pci/probe.c --- a/drivers/pci/probe.c~fix-ide-legacy-mode-resources-fix +++ a/drivers/pci/probe.c @@ -765,12 +765,15 @@ static int pci_setup_device(struct pci_d if (class == PCI_CLASS_STORAGE_IDE) { u8 progif; struct pci_bus_region region; - struct resource resource; + pci_read_config_byte(dev, PCI_CLASS_PROG, &progif); if ((progif & 1) == 0) { - resource.start = 0x1F0; - resource.end = 0x1F7; - resource.flags = LEGACY_IO_RESOURCE; + struct resource resource = { + .start = 0x1F0, + .end = 0x1F7, + .flags = LEGACY_IO_RESOURCE, + }; + pcibios_resource_to_bus(dev, ®ion, &resource); dev->resource[0].start = region.start; dev->resource[0].end = region.end; @@ -784,9 +787,12 @@ static int pci_setup_device(struct pci_d dev->resource[1].flags = resource.flags; } if ((progif & 4) == 0) { - resource.start = 0x170; - resource.end = 0x177; - resource.flags = LEGACY_IO_RESOURCE; + struct resource resource = { + .start = 0x170, + .end = 0x177, + .flags = LEGACY_IO_RESOURCE, + }; + pcibios_resource_to_bus(dev, ®ion, &resource); dev->resource[2].start = region.start; dev->resource[2].end = region.end; _