lkml.org 
[lkml]   [2024]   [Jan]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: Build regressions/improvements in v6.8-rc2
From
On 1/29/24 03:06, Geert Uytterhoeven wrote:
[ ... ]
> parisc-gcc1[23]/parisc-{allmod,def}config
>
>   + /kisskb/src/drivers/hwmon/pc87360.c: error: writing 1 byte into a region of size 0 [-Werror=stringop-overflow=]:  => 383:51
>

The "fix" for this problem would be similar to commit 4265eb062a73 ("hwmon: (pc87360)
Bounds check data->innr usage"). The change would be something like

- for (i = 0; i < data->tempnr; i++) {
+ for (i = 0; i < min(data->tempnr, ARRAY_SIZE(data->temp_max)); i++) {

but that would be purely random because the loop accesses several arrays
indexed with i, and tempnr is never >= ARRAY_SIZE(data->temp_max).
I kind of resist making such changes to the code just because the compiler
is clueless.

Are we sprinkling the kernel code with code like this to make the compiler happy ?

Guenter


\
 
 \ /
  Last update: 2024-01-29 15:59    [W:0.080 / U:0.476 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site