Re: linux-next: build warning after merge of the net tree

Stephen Rothwell
2019-12-05T23:48:30Z

[-- Attachment #1: Type: text/plain, Size: 979 bytes --]

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

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]