acerhdf: driver didn't verify the pointers in which it got product information
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.
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(+)
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
@@ -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 );
_