Re: [PATCH] CHROMIUM: acerhdf: fix bug when running on Qemu

From: Rahul Chaturvedi
Date: Thu May 06 2010 - 01:45:11 EST


BTW, the CHROMIUM in the subject is just used for internal bookeeping
for patches not yet accepted upstream.

On Wed, May 5, 2010 at 22:06, Rahul Chaturvedi <rkc@xxxxxxxxxxxx> wrote:
> 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 <rkc@xxxxxxxxxxxx>
> ---
>  drivers/platform/x86/acerhdf.c |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/platform/x86/acerhdf.c b/drivers/platform/x86/acerhdf.c
> index 4d922e4..e8ee3b2 100644
> --- a/drivers/platform/x86/acerhdf.c
> +++ b/drivers/platform/x86/acerhdf.c
> @@ -500,6 +500,11 @@ static int acerhdf_check_hardware(void)
>        product = dmi_get_system_info(DMI_PRODUCT_NAME);
>
>
> +       if (!vendor || !version || !product) {
> +               pr_err("error getting hardware information");
> +               return -EINVAL;
> +       }
> +
>        pr_info("Acer Aspire One Fan driver, v.%s\n", DRV_VER);
>
>        if (force_bios[0]) {
> --
> 1.7.0.1
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/