lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1398145479-11400-1-git-send-email-nasa4836@gmail.com>
Date:	Tue, 22 Apr 2014 13:44:39 +0800
From:	Jianyu Zhan <nasa4836@...il.com>
To:	tj@...nel.org, lizefan@...wei.com
Cc:	containers@...ts.linux-foundation.org, cgroups@...r.kernel.org,
	linux-kernel@...r.kernel.org, nasa4836@...il.com
Subject: [PATCH] cgroup: use uninitialized_var() for may-be uninitialized variable

To suppress this warning:

 warning: ‘err’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  int err;
	^

Use the uninitialized_var() to decalre err. It also serves to be good documetation.

Signed-off-by: Jianyu Zhan <nasa4836@...il.com>
---
 kernel/cgroup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 24675f5..930569c 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -4144,7 +4144,7 @@ static int create_css(struct cgroup *cgrp, struct cgroup_subsys *ss)
 {
 	struct cgroup *parent = cgrp->parent;
 	struct cgroup_subsys_state *css;
-	int err;
+	int uninitialized_var(err);
 
 	lockdep_assert_held(&cgroup_mutex);
 
-- 
2.0.0-rc0

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ