* Too late check in af_packet.c
@ 2004-09-03 20:52 Dave Jones
2004-09-07 20:40 ` David S. Miller
0 siblings, 1 reply; 2+ messages in thread
From: Dave Jones @ 2004-09-03 20:52 UTC (permalink / raw)
To: David S. Miller; +Cc: netdev
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 <davej@redhat.com>
Dave
--- linux-2.6.8/net/packet/af_packet.c~ 2004-09-03 21:48:14.653433072 +0100
+++ linux-2.6.8/net/packet/af_packet.c 2004-09-03 21:49:23.652943552 +0100
@@ -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);
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-09-07 20:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-09-03 20:52 Too late check in af_packet.c Dave Jones
2004-09-07 20:40 ` David S. Miller
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).