cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rdmacg: Fixed uninitialized current resource usage
@ 2017-01-10 17:51 Parav Pandit
       [not found] ` <1484070708-5422-1-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
  0 siblings, 1 reply; 2+ messages in thread
From: Parav Pandit @ 2017-01-10 17:51 UTC (permalink / raw)
  To: cgroups-u79uwXL29TY76Z2rM5mHXA, tj-DgEjT+Ai2ygdnm+yROfE0A
  Cc: pandit.parav-Re5JQEeQqe8AvxtiuMwx3w

Fixed warning reported by kbuild test robot.
When reading current resource usage value, when no resources are
allocated, its possible that it can report a uninitialized value
for current resource usage.
This fix avoids it by initializing it to zero as no resource is
allocated.

Signed-off-by: Parav Pandit <pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
---
 kernel/cgroup/rdma.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/kernel/cgroup/rdma.c b/kernel/cgroup/rdma.c
index 021bee7..defad3c 100644
--- a/kernel/cgroup/rdma.c
+++ b/kernel/cgroup/rdma.c
@@ -518,6 +518,8 @@ static void print_rpool_values(struct seq_file *sf,
 		} else {
 			if (rpool)
 				value = rpool->resources[i].usage;
+			else
+				value = 0;
 		}
 
 		if (value == S32_MAX)
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-10 17:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-01-10 17:51 [PATCH] rdmacg: Fixed uninitialized current resource usage Parav Pandit
     [not found] ` <1484070708-5422-1-git-send-email-pandit.parav-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-01-10 17:53   ` Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).