X-Git-Url: https://git.karo-electronics.de/?a=blobdiff_plain;f=drivers%2Fpci%2Fpci-sysfs.c;h=dfc4e0ddf241b57a93c8e94d3f81a583a772074c;hb=adfafefd104d840ee4461965f22624d77532675b;hp=db7ec14fa7191828d91f58eb903bfc94cd60ef8c;hpb=cb7a97d01521797cad9f63e8478403c3e51fea49;p=karo-tx-linux.git diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c index db7ec14fa719..dfc4e0ddf241 100644 --- a/drivers/pci/pci-sysfs.c +++ b/drivers/pci/pci-sysfs.c @@ -768,8 +768,8 @@ pci_read_rom(struct kobject *kobj, struct bin_attribute *bin_attr, return -EINVAL; rom = pci_map_rom(pdev, &size); /* size starts out as PCI window size */ - if (!rom) - return 0; + if (!rom || !size) + return -EIO; if (off >= size) count = 0;