Driver didn't verify the pointers in which it got product information
back from DMI; on QEMU one of the pointers came back null,
which made the driver crash and subsequently caused a kernel panic.
Signed-off-by: Rahul Chaturvedi <rkc@xxxxxxxxxxxx>
---
drivers/platform/x86/acerhdf.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
index 4d922e4..e8ee3b2 100644
--- a/drivers/platform/x86/acerhdf.c
+++ b/drivers/platform/x86/acerhdf.c
@@ -500,6 +500,11 @@ static int acerhdf_check_hardware(void)
product = dmi_get_system_info(DMI_PRODUCT_NAME);
+ if (!vendor || !version || !product) {
+ pr_err("error getting hardware information");
+ return -EINVAL;
+ }
+
pr_info("Acer Aspire One Fan driver, v.%s\n", DRV_VER);
if (force_bios[0]) {
--
1.7.0.1