Zhang Rui
9899097b1f
hwmon: (coretemp) Fix potentially truncated sysfs attribute name
...
[ Upstream commit bbfff736d30e5283ad09e748caff979d75ddef7f ]
When build with W=1 and "-Werror=format-truncation", below error is
observed in coretemp driver,
drivers/hwmon/coretemp.c: In function 'create_core_data':
>> drivers/hwmon/coretemp.c:393:34: error: '%s' directive output may be truncated writing likely 5 or more bytes into a region of size between 3 and 13 [-Werror=format-truncation=]
393 | "temp%d_%s", attr_no, suffixes[i]);
| ^~
drivers/hwmon/coretemp.c:393:26: note: assuming directive output of 5 bytes
393 | "temp%d_%s", attr_no, suffixes[i]);
| ^~~~~~~~~~~
drivers/hwmon/coretemp.c:392:17: note: 'snprintf' output 7 or more bytes (assuming 22) into a destination of size 19
392 | snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
393 | "temp%d_%s", attr_no, suffixes[i]);
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Given that
1. '%d' could take 10 charactors,
2. '%s' could take 10 charactors ("crit_alarm"),
3. "temp", "_" and the NULL terminator take 6 charactors,
fix the problem by increasing CORETEMP_NAME_LENGTH to 28.
Signed-off-by: Zhang Rui <rui.zhang@intel.com >
Fixes: 7108b80a542b ("hwmon/coretemp: Handle large core ID value")
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202310200443.iD3tUbbK-lkp@intel.com/
Link: https://lore.kernel.org/r/20231025122316.836400-1-rui.zhang@intel.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-11-20 11:06:48 +01:00
..
2021-05-19 10:13:13 +02:00
2023-08-16 18:20:59 +02:00
2019-10-18 19:37:08 +01:00
2019-05-24 17:36:45 +02:00
2019-11-06 14:37:19 -08:00
2019-05-30 11:29:22 -07:00
2019-05-30 11:29:22 -07:00
2020-06-25 16:06:06 -07:00
2019-05-30 11:25:18 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:40 -07:00
2019-05-24 17:36:45 +02:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-24 07:44:51 -07:00
2020-09-23 09:42:40 -07:00
2019-05-24 17:36:42 +02:00
2019-05-24 17:36:45 +02:00
2017-11-02 11:10:55 +01:00
2019-05-30 11:25:18 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2022-05-12 12:25:37 +02:00
2023-05-17 11:47:31 +02:00
2020-09-23 09:42:39 -07:00
2021-01-12 20:18:22 +01:00
2020-11-12 07:00:59 -08:00
2019-09-03 12:47:17 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:40 -07:00
2020-07-05 20:45:45 -07:00
2019-06-23 18:33:01 -07:00
2020-09-23 09:42:39 -07:00
2023-11-20 11:06:48 +01:00
2020-10-04 08:40:10 -07:00
2020-10-04 08:40:10 -07:00
2023-11-20 11:06:48 +01:00
2020-07-24 07:44:57 -07:00
2020-05-13 10:06:09 -07:00
2019-05-30 11:26:32 -07:00
2022-02-16 12:54:30 +01:00
2020-09-23 09:42:40 -07:00
2022-08-21 15:15:35 +02:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:40 -07:00
2019-05-24 17:36:45 +02:00
2022-05-18 10:23:45 +02:00
2020-09-23 09:42:40 -07:00
2020-06-15 19:25:53 +02:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2022-09-08 11:11:38 +02:00
2023-07-27 08:43:51 +02:00
2020-09-23 09:42:39 -07:00
2020-08-23 17:36:59 -05:00
2023-04-05 11:23:37 +02:00
2020-08-04 14:24:39 -07:00
2022-12-08 11:23:55 +01:00
2022-07-07 17:52:20 +02:00
2022-12-08 11:23:55 +01:00
2020-03-11 08:09:31 -07:00
2019-09-03 12:47:17 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2023-03-22 13:30:01 +01:00
2020-10-04 08:40:10 -07:00
2023-04-05 11:23:37 +02:00
2023-01-14 10:16:20 +01:00
2019-09-03 12:47:17 -07:00
2023-05-17 11:47:31 +02:00
2023-01-14 10:15:37 +01:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2021-07-14 16:56:07 +02:00
2020-09-23 09:42:40 -07:00
2020-10-04 08:40:10 -07:00
2020-05-22 06:28:38 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2021-05-26 12:06:54 +02:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:40 -07:00
2022-02-01 17:25:46 +01:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2019-04-15 17:19:53 -07:00
2023-03-11 16:39:37 +01:00
2022-12-08 11:23:54 +01:00
2020-09-23 09:42:40 -07:00
2019-11-06 14:37:19 -08:00
2019-11-06 14:37:19 -08:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2019-05-21 11:28:45 +02:00
2020-10-14 15:56:58 -07:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:37:06 +02:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2021-07-14 16:56:07 +02:00
2020-09-23 09:42:39 -07:00
2021-07-14 16:56:08 +02:00
2019-02-18 14:23:29 -08:00
2020-09-23 09:42:39 -07:00
2019-05-30 11:26:32 -07:00
2023-03-11 16:39:37 +01:00
2022-09-15 11:32:06 +02:00
2020-07-19 16:25:20 -07:00
2020-08-23 17:36:59 -05:00
2023-08-11 11:57:42 +02:00
2020-09-23 09:42:39 -07:00
2019-09-03 12:47:17 -07:00
2019-06-05 17:37:14 +02:00
2019-05-30 11:26:35 -07:00
2019-05-24 17:36:45 +02:00
2019-05-30 11:26:41 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2021-01-19 18:27:25 +01:00
2019-09-03 12:47:17 -07:00
2020-08-19 21:44:11 +02:00
2022-04-08 14:40:00 +02:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2019-05-30 11:26:35 -07:00
2020-09-23 09:42:41 -07:00
2021-06-23 14:42:49 +02:00
2020-09-23 09:42:39 -07:00
2019-04-17 10:37:23 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:40 -07:00
2019-05-24 17:36:45 +02:00
2020-09-17 16:02:42 +01:00
2020-09-23 09:42:39 -07:00
2019-05-24 17:36:45 +02:00
2019-06-23 18:33:01 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:39:40 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2022-05-18 10:23:42 +02:00
2021-10-06 15:55:53 +02:00
2023-09-19 12:20:10 +02:00
2019-05-21 10:50:45 +02:00
2019-05-30 11:26:41 -07:00
2019-05-24 17:36:45 +02:00
2020-03-24 21:33:36 +01:00
2019-05-24 17:36:45 +02:00
2020-08-04 14:24:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:40:33 -07:00
2020-08-23 17:36:59 -05:00
2020-09-23 09:42:39 -07:00
2020-09-23 09:42:39 -07:00
2021-10-06 15:55:47 +02:00
2021-10-06 15:55:47 +02:00
2021-10-06 15:55:47 +02:00
2020-09-23 09:42:40 -07:00
2019-06-05 17:30:30 +02:00
2019-06-05 17:30:30 +02:00
2023-03-22 13:30:01 +01:00