[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 45/51] hw/net/eepro100: Abort if pci_add_capability() ever fail
From: |
Jason Wang |
Subject: |
[PULL 45/51] hw/net/eepro100: Abort if pci_add_capability() ever fail |
Date: |
Tue, 7 Mar 2023 15:08:10 +0800 |
From: Philippe Mathieu-Daudé <philmd@linaro.org>
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>
Signed-off-by: Jason Wang <jasowang@redhat.com>
---
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 dc07984..dce7503 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.7.4
- [PULL 31/51] e1000: Count CRC in Tx statistics, (continued)
- [PULL 31/51] e1000: Count CRC in Tx statistics, Jason Wang, 2023/03/07
- [PULL 32/51] e1000e: Count CRC in Tx statistics, Jason Wang, 2023/03/07
- [PULL 37/51] e1000: Split header files, Jason Wang, 2023/03/07
- [PULL 34/51] e1000e: Implement system clock, Jason Wang, 2023/03/07
- [PULL 33/51] net/eth: Report if headers are actually present, Jason Wang, 2023/03/07
- [PULL 36/51] pcie: Introduce pcie_sriov_num_vfs, Jason Wang, 2023/03/07
- [PULL 39/51] tests/qtest/e1000e-test: Fabricate ethernet header, Jason Wang, 2023/03/07
- [PULL 35/51] net/eth: Introduce EthL4HdrProto, Jason Wang, 2023/03/07
- [PULL 38/51] Intrdocue igb device emulation, Jason Wang, 2023/03/07
- [PULL 42/51] tests/avocado: Add igb test, Jason Wang, 2023/03/07
- [PULL 45/51] hw/net/eepro100: Abort if pci_add_capability() ever fail,
Jason Wang <=
- [PULL 44/51] ebpf: fix compatibility with libbpf 1.0+, Jason Wang, 2023/03/07
- [PULL 48/51] hw/net/eepro100: Pass E100PCIDeviceInfo as class init data, Jason Wang, 2023/03/07
- [PULL 47/51] hw/net/eepro100: Convert reset handler to DeviceReset, Jason Wang, 2023/03/07
- [PULL 43/51] docs/system/devices/igb: Add igb documentation, Jason Wang, 2023/03/07
- [PULL 40/51] tests/qtest/libqos/e1000e: Export macreg functions, Jason Wang, 2023/03/07
- [PULL 50/51] hw/net/eepro100: Remove instance's EEPRO100State::device, Jason Wang, 2023/03/07
- [PULL 49/51] hw/net/eepro100: Remove instance EEPRO100State::has_extended_tcb_support, Jason Wang, 2023/03/07
- [PULL 41/51] igb: Introduce qtest for igb device, Jason Wang, 2023/03/07
- [PULL 46/51] hw/net/eepro100: Introduce TYPE_EEPRO100 QOM abstract parent, Jason Wang, 2023/03/07
- [PULL 51/51] hw/net/eepro100: Replace DO_UPCAST(EEPRO100State) by EEPRO100(), Jason Wang, 2023/03/07