net/tipc/port.c: fix NULL dereference
Subsystems (3)
PATCH 1/1 net/tipc/port.c: fix NULL dereference
The correct order is: NULL check before dereference
Spotted by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>
net/tipc/port.c renamed from net/tipc/port.c.old +3 -2
@@ -1136,11 +1136,12 @@int res = -EINVAL ; p_ptr =tipc_port_lock (ref); +if (!p_ptr) +return -EINVAL ; +dbg ("tipc_publ %u, p_ptr = %x, conn = %x, scope = %x, " "lower = %u, upper = %u\n" , ref, p_ptr, p_ptr->publ.connected, scope, seq->lower, seq->upper); -if (!p_ptr) -return -EINVAL ;if (p_ptr->publ.connected) goto exit;if (seq->lower > seq->upper)
From: Adrian Bunk <[email protected]>
Date: Wed, 1 Nov 2006 01:40:37 +0100
Quoted 5 lines
The correct order is: NULL check before dereference
Spotted by the Coverity checker.
Signed-off-by Adrian Bunk <[email protected]>
Applied, thanks Adrian.