diff options
author | Sunil Mushran <sunil.mushran@oracle.com> | 2013-09-11 17:19:49 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-09-11 18:56:34 -0400 |
commit | 8dd7903e48df3779bc424196c22dc73b66d0643e (patch) | |
tree | c251a8e5aab3af60b93b5db21569c62aa0ace7a3 /fs | |
parent | 7e9b79370733945b25c24e09d663b07c3936d10c (diff) |
fs/ocfs2/cluster/tcp.c: fix possible null pointer dereferences
Fix some possible null pointer dereferences that were detected by the
static code analyser, smatch.
Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com>
Reported-by: Dan Carpenter <error27@gmail.com>
Reported-by: Guozhonghua <guozhonghua@h3c.com>
Cc: Sunil Mushran <sunil.mushran@gmail.com>
Cc: Joseph Qi <joseph.qi@huawei.com>
Cc: Mark Fasheh <mfasheh@suse.com>
Cc: Joel Becker <jlbec@evilplan.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ocfs2/cluster/tcp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/fs/ocfs2/cluster/tcp.c b/fs/ocfs2/cluster/tcp.c index d644dc611425..d04a3c2fad3c 100644 --- a/fs/ocfs2/cluster/tcp.c +++ b/fs/ocfs2/cluster/tcp.c | |||
@@ -543,8 +543,9 @@ static void o2net_set_nn_state(struct o2net_node *nn, | |||
543 | } | 543 | } |
544 | 544 | ||
545 | if (was_valid && !valid) { | 545 | if (was_valid && !valid) { |
546 | printk(KERN_NOTICE "o2net: No longer connected to " | 546 | if (old_sc) |
547 | SC_NODEF_FMT "\n", SC_NODEF_ARGS(old_sc)); | 547 | printk(KERN_NOTICE "o2net: No longer connected to " |
548 | SC_NODEF_FMT "\n", SC_NODEF_ARGS(old_sc)); | ||
548 | o2net_complete_nodes_nsw(nn); | 549 | o2net_complete_nodes_nsw(nn); |
549 | } | 550 | } |
550 | 551 | ||
@@ -1695,13 +1696,12 @@ static void o2net_start_connect(struct work_struct *work) | |||
1695 | ret = 0; | 1696 | ret = 0; |
1696 | 1697 | ||
1697 | out: | 1698 | out: |
1698 | if (ret) { | 1699 | if (ret && sc) { |
1699 | printk(KERN_NOTICE "o2net: Connect attempt to " SC_NODEF_FMT | 1700 | printk(KERN_NOTICE "o2net: Connect attempt to " SC_NODEF_FMT |
1700 | " failed with errno %d\n", SC_NODEF_ARGS(sc), ret); | 1701 | " failed with errno %d\n", SC_NODEF_ARGS(sc), ret); |
1701 | /* 0 err so that another will be queued and attempted | 1702 | /* 0 err so that another will be queued and attempted |
1702 | * from set_nn_state */ | 1703 | * from set_nn_state */ |
1703 | if (sc) | 1704 | o2net_ensure_shutdown(nn, sc, 0); |
1704 | o2net_ensure_shutdown(nn, sc, 0); | ||
1705 | } | 1705 | } |
1706 | if (sc) | 1706 | if (sc) |
1707 | sc_put(sc); | 1707 | sc_put(sc); |