diff options
author | 2025-04-07 18:13:26 +0300 | |
---|---|---|
committer | 2025-05-14 09:24:51 +0100 | |
commit | bd3d14932923a717ebe475122ca7e17200f87a0c (patch) | |
tree | ee63dc291e4f43c3826244ba509fff5421f79e07 /tools/perf/scripts/python/exported-sql-viewer.py | |
parent | leds: multicolor: Fix intensity setting while SW blinking (diff) | |
download | linux-rng-bd3d14932923a717ebe475122ca7e17200f87a0c.tar.xz linux-rng-bd3d14932923a717ebe475122ca7e17200f87a0c.zip |
leds: pca955x: Avoid potential overflow when filling default_label
GCC compiler (Debian 14.2.0-17) is not happy about printing
into a too short buffer (when build with `make W=1`):
drivers/leds/leds-pca955x.c:554:33: note: ‘snprintf’ output between 2 and 12 bytes into a destination of size 8
Indeed, the buffer size is chosen based on some assumptions,
while in general the assigned value might not fit (GCC can't
prove it does).
Fix this by changing the bits field in the struct pca955x_chipdef to u8,
with a positive side effect of the better memory footprint, and convert
loop iterator to be unsigned. With that done, update format specifiers
accordingly.
In one case join back string literal as it improves the grepping over the code
based on the message and remove duplicating information (the driver name is
printed as pert of the dev_*() output [1]) as we touch the same line anyway.
Link: https://lore.kernel.org/r/4ac527f2-c59e-70a2-efd4-da52370ea557@dave.eu/ [1]
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20250407151441.706378-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Lee Jones <lee@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/exported-sql-viewer.py')
0 files changed, 0 insertions, 0 deletions