From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756695AbbCCNqr (ORCPT ); Tue, 3 Mar 2015 08:46:47 -0500 Received: from mail-qg0-f50.google.com ([209.85.192.50]:34300 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755745AbbCCNqp (ORCPT ); Tue, 3 Mar 2015 08:46:45 -0500 Date: Tue, 3 Mar 2015 08:46:42 -0500 From: Tejun Heo To: Javier Martinez Canillas Cc: Li Zefan , cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/1] cgroup: fix var may be used uninitialized warning Message-ID: <20150303134642.GD3122@htj.duckdns.org> References: <1425373187-7227-1-git-send-email-javier.martinez@collabora.co.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1425373187-7227-1-git-send-email-javier.martinez@collabora.co.uk> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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