Skip to contentSkip to conversation

acerhdf: driver didn't verify the pointers in which it got product information

PATCH New [email protected] 1 participant 1 message Jul 20, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 4/26 acerhdf: driver didn't verify the pointers in which it got product information

From: Rahul Chaturvedi <[email protected]>

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.

---

 drivers/platform/x86/acerhdf.c |    4 ++++
 1 file changed, 4 insertions(+)
drivers/platform/x86/acerhdf.c renamed from drivers/platform/x86/acerhdf.c~acerhdf-driver-didnt-verify-the-pointers-in-which-it-got-product-information +4 -0
diff -puN drivers/platform/x86/acerhdf.c~acerhdf-driver-didnt-verify-the-pointers-in-which-it-got-product-information drivers/platform/x86/acerhdf.c
@@ -524,6 +524,10 @@ static int acerhdf_check_hardware(void)
 	version = dmi_get_system_info(DMI_BIOS_VERSION);
 	product = dmi_get_system_info(DMI_PRODUCT_NAME);
 
+	if (!vendor || !version || !product) {
+		pr_err("error getting hardware information\n");
+		return -EINVAL;
+	}
 
 	pr_info("Acer Aspire One Fan driver, v.%s\n", DRV_VER);
 

_