[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 1/7] hw/net/eepro100: Abort if pci_add_capability() ever fail
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH v2 1/7] hw/net/eepro100: Abort if pci_add_capability() ever fail |
Date: |
Mon, 13 Feb 2023 11:10:42 +0100 |
If pci_add_capability() ever fail, the EEPRO100 device is broken,
which is a bug. No need to report that to the user, abort instead.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
hw/net/eepro100.c | 9 ++-------
1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/hw/net/eepro100.c b/hw/net/eepro100.c
index dc07984ae9..dce75039ec 100644
--- a/hw/net/eepro100.c
+++ b/hw/net/eepro100.c
@@ -549,13 +549,8 @@ static void e100_pci_reset(EEPRO100State *s, Error **errp)
if (info->power_management) {
/* Power Management Capabilities */
int cfg_offset = 0xdc;
- int r = pci_add_capability(&s->dev, PCI_CAP_ID_PM,
- cfg_offset, PCI_PM_SIZEOF,
- errp);
- if (r < 0) {
- return;
- }
-
+ pci_add_capability(&s->dev, PCI_CAP_ID_PM, cfg_offset, PCI_PM_SIZEOF,
+ &error_abort);
pci_set_word(pci_conf + cfg_offset + PCI_PM_PMC, 0x7e21);
#if 0 /* TODO: replace dummy code for power management emulation. */
/* TODO: Power Management Control / Status. */
--
2.38.1
- [PATCH v2 0/7] hw/net/eepro100: Finish QDev conversion, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 1/7] hw/net/eepro100: Abort if pci_add_capability() ever fail,
Philippe Mathieu-Daudé <=
- [PATCH v2 2/7] hw/net/eepro100: Introduce TYPE_EEPRO100 QOM abstract parent, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 3/7] hw/net/eepro100: Convert reset handler to DeviceReset, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 4/7] hw/net/eepro100: Pass E100PCIDeviceInfo as class init data, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 5/7] hw/net/eepro100: Remove instance EEPRO100State::has_extended_tcb_support, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 6/7] hw/net/eepro100: Remove instance's EEPRO100State::device, Philippe Mathieu-Daudé, 2023/02/13
- [PATCH v2 7/7] hw/net/eepro100: Replace DO_UPCAST(EEPRO100State) by EEPRO100(), Philippe Mathieu-Daudé, 2023/02/13
- Re: [PATCH v2 0/7] hw/net/eepro100: Finish QDev conversion, Philippe Mathieu-Daudé, 2023/02/23