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>
This commit is contained in:
parent
8d0b8801c9
commit
405010df1d
1 changed files with 7 additions and 3 deletions
|
@ -1196,19 +1196,23 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv,
|
||||||
struct pcistub_device *psdev;
|
struct pcistub_device *psdev;
|
||||||
struct xen_pcibk_dev_data *dev_data;
|
struct xen_pcibk_dev_data *dev_data;
|
||||||
int domain, bus, slot, func;
|
int domain, bus, slot, func;
|
||||||
int err = -ENOENT;
|
int err;
|
||||||
|
|
||||||
err = str_to_slot(buf, &domain, &bus, &slot, &func);
|
err = str_to_slot(buf, &domain, &bus, &slot, &func);
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
psdev = pcistub_device_find(domain, bus, slot, func);
|
psdev = pcistub_device_find(domain, bus, slot, func);
|
||||||
if (!psdev)
|
if (!psdev) {
|
||||||
|
err = -ENOENT;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
dev_data = pci_get_drvdata(psdev->dev);
|
dev_data = pci_get_drvdata(psdev->dev);
|
||||||
if (!dev_data)
|
if (!dev_data) {
|
||||||
|
err = -ENOENT;
|
||||||
goto out;
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n",
|
dev_dbg(&psdev->dev->dev, "%s fake irq handler: %d->%d\n",
|
||||||
dev_data->irq_name, dev_data->isr_on,
|
dev_data->irq_name, dev_data->isr_on,
|
||||||
|
|
Loading…
Reference in a new issue