Re: [PATCH] mm: thp: avoid uninitialized variable use

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/16/17 4:24 AM, Arnd Bergmann wrote:
On Fri, Dec 15, 2017 at 7:01 PM, Yang Shi <yang.s@xxxxxxxxxxxxxxx> wrote:


On 12/15/17 4:51 AM, Arnd Bergmann wrote:

When the down_read_trylock() fails, 'vma' has not been initialized
yet, which gcc now warns about:

mm/khugepaged.c: In function 'khugepaged':
mm/khugepaged.c:1659:25: error: 'vma' may be used uninitialized in this
function [-Werror=maybe-uninitialized]


Arnd,

Thanks for catching this. I'm wondering why my test didn't catch it. It
might be because my gcc is old. I'm using gcc 4.8.5 on centos 7.

Correct, gcc-4.8 and earlier have too many false-positive warnings with
-Wmaybe-uninitialized, so we turn it off on those versions. 4.9 is much
better here, but I'd recommend using gcc-6 or gcc-7 when you upgrade,
they have a much better set of default warnings besides producing better
binary code.

Thanks, I just upgraded gcc to 6.4 on my cetnos 7 machine. But, I ran into a build error with 4.15-rc3 kernel, but 4.14 is fine. I bisected to a commit in Makefile. I will email my bug report to the mailing list.

Regards,
Yang


See http://git.infradead.org/users/segher/buildall.git for a simple way
to build toolchains suitable for building kernels in varying architectures
and versions.

        Arnd


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux