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.
Signed-off-by: Rahul Chaturvedi <[email protected]> Signed-off-by: Peter Feuerer <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Andreas Mohr <[email protected]> Cc: Len Brown <[email protected]> Cc: Matthew Garrett <[email protected]> Signed-off-by: Andrew Morton <[email protected]> --- drivers/platform/x86/acerhdf.c | 4 ++++ 1 file changed, 4 insertions(+) diff -puN drivers/platform/x86/acerhdf.c~acerhdf-driver-didnt-verify-the-pointers-in-which-it-got-product-information drivers/platform/x86/acerhdf.c --- a/drivers/platform/x86/acerhdf.c~acerhdf-driver-didnt-verify-the-pointers-in-which-it-got-product-information +++ a/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); _ -- To unsubscribe from this list: send the line "unsubscribe platform-driver-x86" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
