Too late check in af_packet.c
Subsystems (3)
Using the automated source checker at coverity.com, they picked up on some code in packet_release() where a NULL check was done after dereferencing. Patch below.
Signed-off-by Dave Jones <[email protected]>
Dave
net/packet/af_packet.c renamed from net/packet/af_packet.c~ +3 -1
@@ -785,11 +785,13 @@static int packet_release (struct socket *sock) {struct sock *sk = sock->sk; -struct packet_opt *po =pkt_sk (sk); +struct packet_opt *po;if (!sk)return 0 ; + po =pkt_sk (sk); +write_lock_bh (&packet_sklist_lock);sk_del_node_init (sk);write_unlock_bh (&packet_sklist_lock);
David S. Miller
maintainerQuoted 5 lines · On Fri, 3 Sep 2004 21:52:06 +0100 Dave Jones <[email protected]> wrote:
Using the automated source checker at coverity.com, they picked up on some code in
packet_release()where a NULL check was done after dereferencing. Patch below.Signed-off-by Dave Jones <[email protected]>
Looks great, applied.
Thanks.