From: Rahul Chaturvedi Date: Tue, 20 Jul 2010 22:19:33 +0000 (-0700) Subject: acerhdf: driver didn't verify the pointers in which it got product information X-Git-Tag: v2.6.36-rc1~579^2~53 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=5cf4c07a2805388b5645079039d9a8b4b9269e08;p=karo-tx-linux.git acerhdf: driver didn't verify the pointers in which it got product information 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 Signed-off-by: Peter Feuerer Cc: Borislav Petkov Cc: Andreas Mohr Cc: Len Brown Cc: Matthew Garrett Signed-off-by: Andrew Morton Signed-off-by: Matthew Garrett --- diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 9226838c867f..6abd3f15dd85 100644 --- a/drivers/platform/x86/acerhdf.c +++ b/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);