diff options
author | Wei Yongjun <yongjun_wei@trendmicro.com.cn> | 2013-05-31 19:59:20 +0800 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-06-10 08:43:28 -0400 |
commit | 405010df1dd657151543d93b01578b0c533788b5 (patch) | |
tree | 150f8779b559e3580b6a6665b0c99c5f0922400a /drivers | |
parent | 8d0b8801c9e4c2c6b20cdac74dbab16facce7653 (diff) | |
download | talos-obmc-linux-405010df1dd657151543d93b01578b0c533788b5.tar.gz talos-obmc-linux-405010df1dd657151543d93b01578b0c533788b5.zip |
xen-pciback: fix error return code in pcistub_irq_handler_switch()
Fix to return -ENOENT in the pcistub_device_find() and pci_get_drvdata()
error handling case instead of 0(overwrite to 0 by str_to_slot()), as done
elsewhere in this function.
Acked-by: Jan Beulich <jbeulich@suse.com>
Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/xen/xen-pciback/pci_stub.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/xen/xen-pciback/pci_stub.c b/drivers/xen/xen-pciback/pci_stub.c index 4e8ba38aa0c9..002089918260 100644 --- a/drivers/xen/xen-pciback/pci_stub.c +++ b/drivers/xen/xen-pciback/pci_stub.c @@ -1196,19 +1196,23 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv, struct pcistub_device *psdev; struct xen_pcibk_dev_data *dev_data; int domain, bus, slot, func; - int err = -ENOENT; + int err; err = str_to_slot(buf, &domain, &bus, &slot, &func); if (err) return err; psdev = pcistub_device_find(domain, bus, slot, func); - if (!psdev) + if (!psdev) { + err = -ENOENT; goto out; + } dev_data = pci_get_drvdata(psdev->dev); - if (!dev_data) + if (!dev_data) { + err = -ENOENT; goto out; + } dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n", dev_data->irq_name, dev_data->isr_on, |