Re: [PATCH] cgroup: Initialize root in cgroup_mount

From: Tejun Heo
Date: Tue Jan 27 2015 - 11:10:24 EST


On Mon, Jan 26, 2015 at 04:21:39PM -0800, Jason Low wrote:
> Compiling kernel/ causes warnings:
>
> ... ârootâ may be used uninitialized in this function
> ... ârootâ was declared here
>
> This isn't an issue since there is already logic to not use
> root if we goto out_unlock without setting root.
>
> Explicitly initialize root to NULL to suppress this so that we can
> focus on catching warnings that can potentially cause bigger issues.

Which complier are you using? The variable, AFAICS, is always set
before being deref'd and the function hasn't triggered spurious
warnings for quite a while with differing versions of gcc.

Thanks.

--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/