From: Dave Jones <davej@redhat.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@oss.sgi.com
Subject: Too late check in af_packet.c
Date: Fri, 3 Sep 2004 21:52:06 +0100 [thread overview]
Message-ID: <20040903205206.GT26419@redhat.com> (raw)
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);
next reply other threads:[~2004-09-03 20:52 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-09-03 20:52 Dave Jones [this message]
2004-09-07 20:40 ` Too late check in af_packet.c David S. Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040903205206.GT26419@redhat.com \
--to=davej@redhat.com \
--cc=davem@davemloft.net \
--cc=netdev@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).