lkml.org 
[lkml]   [2019]   [Dec]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: linux-next: build warning after merge of the net tree
Hi Dave,

On Thu, 05 Dec 2019 14:57:39 -0800 (PST) David Miller <davem@davemloft.net> wrote:
>
> I think it is a false positive as well. It looks like the compiler
> has trouble seeing through ptr error guards.
>
> In the new code the compiler can only see that the return value in the
> error case is non-zero, not necessarily that it is < 0 which is the
> guard against uninitialized accesses of 'obj'.
>
> It will satisfy this property, but through the various casts and
> implicit demotions, this information is lost on the compiler.
>
> My compiler didn't emit this warning FWIW.
>
> gcc (GCC) 8.3.1 20190223 (Red Hat 8.3.1-2)
>
> I'm unsure how to handle this, setting 'n' to explicitly be NULL
> is bogus because the compiler now will think that a NULL deref
> happens since the guard isn't guarding the existing assignment.

Yeah, not much we can do.

x86_64-linux-gnu-gcc (Debian 9.2.1-19) 9.2.1 20191109

--
Cheers,
Stephen Rothwell
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2019-12-06 00:49    [W:0.023 / U:16.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site