Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755499Ab0FSLwG (ORCPT ); Sat, 19 Jun 2010 07:52:06 -0400 Received: from smtprelay03.ispgateway.de ([80.67.31.37]:39176 "EHLO smtprelay03.ispgateway.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751500Ab0FSLwE (ORCPT ); Sat, 19 Jun 2010 07:52:04 -0400 Date: Sat, 19 Jun 2010 13:44:46 +0200 From: Peter Feuerer To: Andrew Morton Cc: Peter Feuerer , linux-kernel@vger.kernel.org, Borislav Petkov , lenb@kernel.org, Andreas Mohr Subject: [PATCH 3/4] Driver didn't verify the pointers in which it got product information Message-Id: <20100619134446.7b5e76d3.peter@piie.net> In-Reply-To: <20100619134343.46564310.peter@piie.net> References: <20100619134232.7fedd2f1.peter@piie.net> <20100619134343.46564310.peter@piie.net> X-Mailer: Sylpheed 3.0.2 (GTK+ 2.20.1; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Df-Sender: 650477 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1336 Lines: 38 [PATCH 3/4] 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. From: Rahul Chaturvedi Signed-off-by: Rahul Chaturvedi Signed-off-by: Peter Feuerer Cc: Borislav Petkov Cc: Andreas Mohr Cc: Len Brown --- drivers/platform/x86/acerhdf.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c index 9226838..6abd3f1 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); -- 1.7.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/