lkml.org 
[lkml]   [2015]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 1/1] cgroup: fix var may be used uninitialized warning
On Tue, Mar 03, 2015 at 09:59:47AM +0100, Javier Martinez Canillas wrote:
> When building cgroup, GCC warns that the root variable
> may be used uninitialized in the cgroup_mount function.
>
> kernel/cgroup.c: In function ‘cgroup_mount’:
> kernel/cgroup.c:1886:13: warning: ‘root’ may be used uninitialized in this function [-Wuninitialized]
> kernel/cgroup.c:1742:22: note: ‘root’ was declared here
>
> This can never happen because if the struct cgroup_root
> can't be allocated, ret is set to -ENOMEM and the error
> returned so the code using root is not reachable. But
> set root to NULL just to silence the compiler warning.

Which compiler are you on?

Thanks.

--
tejun


\
 
 \ /
  Last update: 2015-03-03 15:01    [W:0.053 / U:1.124 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site