[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1403281515-5508-1-git-send-email-xerofoify@gmail.com>
Date: Fri, 20 Jun 2014 12:25:15 -0400
From: Nicholas Krause <xerofoify@...il.com>
To: jkosina@...e.cz
Cc: linux-input@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] Fixes kernel panic with Null pointer in hid-appleir.c
In for loop of function appleir_input_configured we hit
a Null pointer after the for loop due to array_size not
being correct needs to be changed to input_dev->keycodemax.
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..ab0a702 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 < ARRAY_SIZE(input_dev->keycodemax); i++)
set_bit(appleir->keymap[i], input_dev->keybit);
clear_bit(KEY_RESERVED, input_dev->keybit);
}
--
1.9.1
--
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