Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 11 Oct 2012 15:06:41 +0200
From:      Erik Cederstrand <erik@cederstrand.dk>
To:        FreeBSD Hackers <hackers@FreeBSD.org>
Subject:   curcpu false positive?
Message-ID:  <3A22DF7A-00BB-408C-8F76-C1E119E0E48C@cederstrand.dk>

next in thread | raw e-mail | index | archive | help
Hello,

I'm looking at some Clang Static Analyzer reports in the kernel, and a =
lot of them point back to a null pointer dereference in __pcpu_type =
(sys/amd64/include/pcpu.h:102) which is defined as:

102	 /*
103	 * Evaluates to the type of the per-cpu variable name.
104	 */
105	#define __pcpu_type(name)                                        =
       \
106	        __typeof(((struct pcpu *)0)->name)


Which indeed looks like a NULL pointer dereference. Looking at the =
latest commit message there, I'm sure the code is correct, but I'm =
unsure why the null pointer is OK. I'd appreciate an explanation :-)

Thanks,
Erik=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3A22DF7A-00BB-408C-8F76-C1E119E0E48C>