Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 329184
b: refs/heads/master
c: e6aa70a
h: refs/heads/master
v: v3
  • Loading branch information
Jan Beulich authored and Konrad Rzeszutek Wilk committed Sep 25, 2012
1 parent a3fe2d7 commit 341afcd
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: aa387d630cfed1a694a9c8c61fba3877ba8d4f07
refs/heads/master: e6aa70a0d5511296ea3d5fd1f5e2203ff6898107
46 changes: 23 additions & 23 deletions trunk/drivers/xen/xen-pciback/pci_stub.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,14 +681,14 @@ static pci_ers_result_t xen_pcibk_slot_reset(struct pci_dev *dev)
dev_err(&dev->dev, DRV_NAME " device is not connected or owned"
" by HVM, kill it\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}

if (!test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags)) {
dev_err(&dev->dev,
"guest with no AER driver should have been killed\n");
goto release;
goto end;
}
result = common_process(psdev, 1, XEN_PCI_OP_aer_slotreset, result);

Expand All @@ -698,9 +698,9 @@ static pci_ers_result_t xen_pcibk_slot_reset(struct pci_dev *dev)
"No AER slot_reset service or disconnected!\n");
kill_domain_by_device(psdev);
}
release:
pcistub_device_put(psdev);
end:
if (psdev)
pcistub_device_put(psdev);
up_write(&pcistub_sem);
return result;

Expand Down Expand Up @@ -739,14 +739,14 @@ static pci_ers_result_t xen_pcibk_mmio_enabled(struct pci_dev *dev)
dev_err(&dev->dev, DRV_NAME " device is not connected or owned"
" by HVM, kill it\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}

if (!test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags)) {
dev_err(&dev->dev,
"guest with no AER driver should have been killed\n");
goto release;
goto end;
}
result = common_process(psdev, 1, XEN_PCI_OP_aer_mmio, result);

Expand All @@ -756,9 +756,9 @@ static pci_ers_result_t xen_pcibk_mmio_enabled(struct pci_dev *dev)
"No AER mmio_enabled service or disconnected!\n");
kill_domain_by_device(psdev);
}
release:
pcistub_device_put(psdev);
end:
if (psdev)
pcistub_device_put(psdev);
up_write(&pcistub_sem);
return result;
}
Expand Down Expand Up @@ -797,15 +797,15 @@ static pci_ers_result_t xen_pcibk_error_detected(struct pci_dev *dev,
dev_err(&dev->dev, DRV_NAME " device is not connected or owned"
" by HVM, kill it\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}

/*Guest owns the device yet no aer handler regiested, kill guest*/
if (!test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags)) {
dev_dbg(&dev->dev, "guest may have no aer driver, kill it\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}
result = common_process(psdev, error, XEN_PCI_OP_aer_detected, result);

Expand All @@ -815,9 +815,9 @@ static pci_ers_result_t xen_pcibk_error_detected(struct pci_dev *dev,
"No AER error_detected service or disconnected!\n");
kill_domain_by_device(psdev);
}
release:
pcistub_device_put(psdev);
end:
if (psdev)
pcistub_device_put(psdev);
up_write(&pcistub_sem);
return result;
}
Expand Down Expand Up @@ -851,21 +851,21 @@ static void xen_pcibk_error_resume(struct pci_dev *dev)
dev_err(&dev->dev, DRV_NAME " device is not connected or owned"
" by HVM, kill it\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}

if (!test_bit(_XEN_PCIB_AERHANDLER,
(unsigned long *)&psdev->pdev->sh_info->flags)) {
dev_err(&dev->dev,
"guest with no AER driver should have been killed\n");
kill_domain_by_device(psdev);
goto release;
goto end;
}
common_process(psdev, 1, XEN_PCI_OP_aer_resume,
PCI_ERS_RESULT_RECOVERED);
release:
pcistub_device_put(psdev);
end:
if (psdev)
pcistub_device_put(psdev);
up_write(&pcistub_sem);
return;
}
Expand Down Expand Up @@ -1024,7 +1024,7 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, int reg,
struct config_field *field;

psdev = pcistub_device_find(domain, bus, slot, func);
if (!psdev || !psdev->dev) {
if (!psdev) {
err = -ENODEV;
goto out;
}
Expand All @@ -1048,6 +1048,8 @@ static int pcistub_reg_add(int domain, int bus, int slot, int func, int reg,
if (err)
kfree(field);
out:
if (psdev)
pcistub_device_put(psdev);
return err;
}

Expand Down Expand Up @@ -1152,10 +1154,9 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv,

err = str_to_slot(buf, &domain, &bus, &slot, &func);
if (err)
goto out;
return err;

psdev = pcistub_device_find(domain, bus, slot, func);

if (!psdev)
goto out;

Expand All @@ -1171,6 +1172,8 @@ static ssize_t pcistub_irq_handler_switch(struct device_driver *drv,
if (dev_data->isr_on)
dev_data->ack_intr = 1;
out:
if (psdev)
pcistub_device_put(psdev);
if (!err)
err = count;
return err;
Expand Down Expand Up @@ -1262,10 +1265,7 @@ static ssize_t permissive_add(struct device_driver *drv, const char *buf,
err = -ENODEV;
goto out;
}
if (!psdev->dev) {
err = -ENODEV;
goto release;
}

dev_data = pci_get_drvdata(psdev->dev);
/* the driver data for a device should never be null at this point */
if (!dev_data) {
Expand Down

0 comments on commit 341afcd

Please sign in to comment.