kernel-janitors.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] ocfs2: o2net: silence uninitialized variable warning
@ 2015-01-23 11:24 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2015-01-23 11:24 UTC (permalink / raw)
  To: ocfs2-devel

Smatch complains that, if o2net_tx_can_proceed() returns false, then
"sc" and "ret" are uninialized or maybe we are re-using the data from
previous iteration.  I do not know if we can hit this bug in real life
but checking the return value is harmless and we may as well silence the
static checker warning.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c
index 2e355e0..56c403a 100644
--- a/fs/ocfs2/cluster/tcp.c
+++ b/fs/ocfs2/cluster/tcp.c
@@ -1016,7 +1016,8 @@ void o2net_fill_node_map(unsigned long *map, unsigned bytes)
 
 	memset(map, 0, bytes);
 	for (node = 0; node < O2NM_MAX_NODES; ++node) {
-		o2net_tx_can_proceed(o2net_nn_from_num(node), &sc, &ret);
+		if (!o2net_tx_can_proceed(o2net_nn_from_num(node), &sc, &ret))
+			continue;
 		if (!ret) {
 			set_bit(node, map);
 			sc_put(sc);

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-01-23 11:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-23 11:24 [patch] ocfs2: o2net: silence uninitialized variable warning Dan Carpenter

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).