UPSTREAM: drvs/intel/wifi/wifi: Fix regression

Fix regression introduced by commit 5c026445
(drivers/intel/wifi: Add support for generating SSDT table)

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.

Add NULL pointer checks and only fill in device name if one is provided.

Tested on Lenovo T430 and wifi card 8086:0085.

BUG=none
BRANCH=none
TEST=none

Change-Id: Ieb95c7f281d8f69ecf3cc2e0e176a24923891a2f
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Original-Commit-Id: 6086b4ee38
Original-Change-Id: I84e804f033bcd3af1a7f76670275fdf5159d381f
Original-Signed-off-by: Patrick Rudolph <siro@das-labor.org>
Original-Reviewed-on: https://review.coreboot.org/20082
Original-Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Original-Reviewed-by: Duncan Laurie <dlaurie@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/528269
Commit-Ready: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
This commit is contained in:
Patrick Rudolph 2017-06-07 09:39:28 +02:00 committed by chrome-bot
parent e76cd0eb9c
commit f950cf4d68

View file

@ -145,7 +145,8 @@ static void intel_wifi_fill_ssdt(struct device *dev)
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);
if (dev->chip_ops)
acpigen_write_name_string("_DDN", dev->chip_ops->name);
/* Address */
address = PCI_SLOT(dev->path.pci.devfn) & 0xffff;
@ -186,7 +187,7 @@ static void intel_wifi_fill_ssdt(struct device *dev)
acpigen_pop_len(); /* Scope */
printk(BIOS_INFO, "%s.%s: %s %s\n", path, acpi_device_name(dev),
dev->chip_ops->name, dev_path(dev));
dev->chip_ops ? dev->chip_ops->name : "", dev_path(dev));
}
static const char *intel_wifi_acpi_name(struct device *dev)