[coreboot-gerrit] Change in coreboot[master]: drvs/intel/wifi/wifi: Fix regression

Patrick Rudolph (Code Review) gerrit at coreboot.org
Wed Jun 7 09:50:55 CEST 2017


Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/20082


Change subject: drvs/intel/wifi/wifi: Fix regression
......................................................................

drvs/intel/wifi/wifi: Fix regression

Fix regression introduced by Change-Id:
I8b5c916f1a04742507dc1ecc9a20c19d3822b18c

In case the regular PCI path is taken, there're no chip_ops and the code
will segfault.
The bug was covered by other bugs that caused this code to never execute.

Don't assume the chip_operations path was taken and instead define the
device name, to be used all over the code.

Tested on Lenovo T430 and wifi card 8086:0085.

Change-Id: I84e804f033bcd3af1a7f76670275fdf5159d381f
Signed-off-by: Patrick Rudolph <siro at das-labor.org>
---
M src/drivers/intel/wifi/wifi.c
1 file changed, 5 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/82/20082/1

diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c
index 15cb2c1..dbffea1 100644
--- a/src/drivers/intel/wifi/wifi.c
+++ b/src/drivers/intel/wifi/wifi.c
@@ -26,6 +26,8 @@
 #include <wrdd.h>
 #include "chip.h"
 
+#define DEVICE_NAME "Intel WiFi"
+
 #if IS_ENABLED(CONFIG_GENERATE_SMBIOS_TABLES)
 static int smbios_write_wifi(struct device *dev, int *handle,
 			     unsigned long *current)
@@ -145,7 +147,7 @@
 	acpigen_write_scope(path);
 	acpigen_write_device(acpi_device_name(dev));
 	acpigen_write_name_integer("_UID", 0);
-	acpigen_write_name_string("_DDN", dev->chip_ops->name);
+	acpigen_write_name_string("_DDN", DEVICE_NAME);
 
 	/* Address */
 	address = PCI_SLOT(dev->path.pci.devfn) & 0xffff;
@@ -186,7 +188,7 @@
 	acpigen_pop_len(); /* Scope */
 
 	printk(BIOS_INFO, "%s.%s: %s %s\n", path, acpi_device_name(dev),
-	       dev->chip_ops->name, dev_path(dev));
+	       DEVICE_NAME, dev_path(dev));
 }
 
 static const char *intel_wifi_acpi_name(struct device *dev)
@@ -235,6 +237,6 @@
 }
 
 struct chip_operations drivers_intel_wifi_ops = {
-	CHIP_NAME("Intel WiFi")
+	CHIP_NAME(DEVICE_NAME)
 	.enable_dev = &intel_wifi_enable
 };

-- 
To view, visit https://review.coreboot.org/20082
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I84e804f033bcd3af1a7f76670275fdf5159d381f
Gerrit-Change-Number: 20082
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Rudolph <siro at das-labor.org>



More information about the coreboot-gerrit mailing list