From: Adrian Bunk <bunk@kernel.org>
To: netdev@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: [2.6 patch] net/8021q/vlanproc.c: fix check-after-use
Date: Tue, 14 Aug 2007 23:22:44 +0200 [thread overview]
Message-ID: <20070814212244.GB18945@stusta.de> (raw)
The Coverity checker spotted that we'd have already oops'ed if "vlandev"
was NULL.
Signed-off-by: Adrian Bunk <bunk@kernel.org>
---
--- linux-2.6.23-rc1-mm2/net/8021q/vlanproc.c.old 2007-08-08 06:22:40.000000000 +0200
+++ linux-2.6.23-rc1-mm2/net/8021q/vlanproc.c 2007-08-08 06:23:13.000000000 +0200
@@ -314,17 +314,17 @@
static int vlandev_seq_show(struct seq_file *seq, void *offset)
{
struct net_device *vlandev = (struct net_device *) seq->private;
const struct vlan_dev_info *dev_info = VLAN_DEV_INFO(vlandev);
struct net_device_stats *stats;
static const char fmt[] = "%30s %12lu\n";
int i;
- if ((vlandev == NULL) || (!(vlandev->priv_flags & IFF_802_1Q_VLAN)))
+ if (!(vlandev->priv_flags & IFF_802_1Q_VLAN))
return 0;
seq_printf(seq, "%s VID: %d REORDER_HDR: %i dev->priv_flags: %hx\n",
vlandev->name, dev_info->vlan_id,
(int)(dev_info->flags & 1), vlandev->priv_flags);
stats = vlan_dev_get_stats(vlandev);
next reply other threads:[~2007-08-14 21:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-14 21:22 Adrian Bunk [this message]
2007-08-15 0:39 ` [2.6 patch] net/8021q/vlanproc.c: fix check-after-use David 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=20070814212244.GB18945@stusta.de \
--to=bunk@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/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).