diff options
Diffstat (limited to 'recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch')
-rw-r--r-- | recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch new file mode 100644 index 00000000..dc75f169 --- /dev/null +++ b/recipes-kernel/linux/linux-ti33x-psp-3.2/3.2.22/0006-hwmon-applesmc-Limit-key-length-in-warning-messages.patch | |||
@@ -0,0 +1,43 @@ | |||
1 | From d94e9fcf553861cd10a1780c6aeaa6a4419ba5ce Mon Sep 17 00:00:00 2001 | ||
2 | From: Henrik Rydberg <rydberg@euromail.se> | ||
3 | Date: Thu, 7 Jun 2012 04:54:29 -0400 | ||
4 | Subject: [PATCH 06/46] hwmon: (applesmc) Limit key length in warning messages | ||
5 | |||
6 | commit ac852edb47b15900886ba2564eeeb13b3b526e3e upstream. | ||
7 | |||
8 | Key lookups may call read_smc() with a fixed-length key string, | ||
9 | and if the lookup fails, trailing stack content may appear in the | ||
10 | kernel log. Fixed with this patch. | ||
11 | |||
12 | Signed-off-by: Henrik Rydberg <rydberg@euromail.se> | ||
13 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | ||
14 | Signed-off-by: Ben Hutchings <ben@decadent.org.uk> | ||
15 | --- | ||
16 | drivers/hwmon/applesmc.c | 4 ++-- | ||
17 | 1 file changed, 2 insertions(+), 2 deletions(-) | ||
18 | |||
19 | diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c | ||
20 | index 4c07436..d99aa84 100644 | ||
21 | --- a/drivers/hwmon/applesmc.c | ||
22 | +++ b/drivers/hwmon/applesmc.c | ||
23 | @@ -215,7 +215,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | ||
24 | int i; | ||
25 | |||
26 | if (send_command(cmd) || send_argument(key)) { | ||
27 | - pr_warn("%s: read arg fail\n", key); | ||
28 | + pr_warn("%.4s: read arg fail\n", key); | ||
29 | return -EIO; | ||
30 | } | ||
31 | |||
32 | @@ -223,7 +223,7 @@ static int read_smc(u8 cmd, const char *key, u8 *buffer, u8 len) | ||
33 | |||
34 | for (i = 0; i < len; i++) { | ||
35 | if (__wait_status(0x05)) { | ||
36 | - pr_warn("%s: read data fail\n", key); | ||
37 | + pr_warn("%.4s: read data fail\n", key); | ||
38 | return -EIO; | ||
39 | } | ||
40 | buffer[i] = inb(APPLESMC_DATA_PORT); | ||
41 | -- | ||
42 | 1.7.10 | ||
43 | |||