aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/xen
diff options
context:
space:
mode:
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>2013-05-31 07:59:20 -0400
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>2013-06-10 08:43:28 -0400
commit405010df1dd657151543d93b01578b0c533788b5 (patch)
tree150f8779b559e3580b6a6665b0c99c5f0922400a /drivers/xen
parent8d0b8801c9e4c2c6b20cdac74dbab16facce7653 (diff)
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/xen')
-rw-r--r--drivers/xen/xen-pciback/pci_stub.c10
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,
1196 struct pcistub_device *psdev; 1196 struct pcistub_device *psdev;
1197 struct xen_pcibk_dev_data *dev_data; 1197 struct xen_pcibk_dev_data *dev_data;
1198 int domain, bus, slot, func; 1198 int domain, bus, slot, func;
1199 int err = -ENOENT; 1199 int err;
1200 1200
1201 err = str_to_slot(buf, &domain, &bus, &slot, &func); 1201 err = str_to_slot(buf, &domain, &bus, &slot, &func);
1202 if (err) 1202 if (err)
1203 return err; 1203 return err;
1204 1204
1205 psdev = pcistub_device_find(domain, bus, slot, func); 1205 psdev = pcistub_device_find(domain, bus, slot, func);
1206 if (!psdev) 1206 if (!psdev) {
1207 err = -ENOENT;
1207 goto out; 1208 goto out;
1209 }
1208 1210
1209 dev_data = pci_get_drvdata(psdev->dev); 1211 dev_data = pci_get_drvdata(psdev->dev);
1210 if (!dev_data) 1212 if (!dev_data) {
1213 err = -ENOENT;
1211 goto out; 1214 goto out;
1215 }
1212 1216
1213 dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n", 1217 dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n",
1214 dev_data->irq_name, dev_data->isr_on, 1218 dev_data->irq_name, dev_data->isr_on,