lkml.org 
[lkml]   [2018]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: linux-4.16-rc1/drivers/misc/ocxl/file.c:320:broken error checking ?
From
Date


Le 12/02/2018 à 09:58, David Binderman a écrit :
> Hello there,
>
>
> linux-4.16-rc1/drivers/misc/ocxl/file.c:320]: (style) Checking if
> unsigned variable 'used' is less than zero.
>
> Source code is
>
>
>        used = append_xsl_error(ctx, &header, buf + sizeof(header));
>         if (used < 0)
>             return used;
>
> Suggest put return value from function into signed variable, sanity
> check it,
>
> then assign it to an unsigned variable.
>
>
> Also, use of the gcc compiler flag -Wtype-limits will show up this kind
> of problem in future.

Thanks for reporting it. A patch to address it is working its way up and
should land in the next rc release.

Fred


>
> Regards
>
>
> David Binderman
>
>

\
 
 \ /
  Last update: 2018-02-12 10:54    [W:0.238 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site