[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LNX.2.00.1407010837370.1655@pobox.suse.cz>
Date: Tue, 1 Jul 2014 08:39:06 +0200 (CEST)
From: Jiri Kosina <jkosina@...e.cz>
To: Nicholas Krause <xerofoify@...il.com>
cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] hid-appleir: Fix kernel panic due to null pointer
On Mon, 30 Jun 2014, Nicholas Krause wrote:
> Fixes a null pointer in appleir_input_configured due to reading
> into wrong size array. Changed the variable to input_dev->keycodemax.
This is a stale changelog from the previous buggy version.
> Signed-off-by: Nicholas Krause <xerofoify@...il.com>
> ---
> drivers/hid/hid-appleir.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hid/hid-appleir.c b/drivers/hid/hid-appleir.c
> index 0e6a42d..cc02df4 100644
> --- a/drivers/hid/hid-appleir.c
> +++ b/drivers/hid/hid-appleir.c
> @@ -272,7 +272,7 @@ static void appleir_input_configured(struct hid_device *hid,
> input_dev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP);
>
> memcpy(appleir->keymap, appleir_key_table, sizeof(appleir->keymap));
> - for (i = 0; i < ARRAY_SIZE(appleir_key_table); i++)
> + for (i = 0; i < appleir->keymap; i++)
This is wrong. appleir->keymap is an array, and you want to count its
elements.
Third time is the charm perhaps?
--
Jiri Kosina
SUSE Labs
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists