From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Dan Carpenter <dan.carpenter@oracle.com>,
netdev@vger.kernel.org, linux-scsi@vger.kernel.org
Subject: Re: [SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference (v2)
Date: Mon, 26 Sep 2011 09:31:15 -0500 [thread overview]
Message-ID: <1317047476.9560.0.camel@dabdike> (raw)
In-Reply-To: <20110926142052.GA18283@hmsreliant.think-freely.org>
On Mon, 2011-09-26 at 10:20 -0400, Neil Horman wrote:
> On Mon, Sep 26, 2011 at 04:40:48PM +0300, Dan Carpenter wrote:
> > Hi Neil,
> >
> > c98bc57ee65b6 "[SCSI] cxgb3i: convert cdev->l2opt to use rcu to
> > prevent NULL dereference (v2)" from linux-next introduces a usinging
> > uninitialized variable bug.
> >
> > struct l2t_entry *t3_l2t_get(struct t3cdev *cdev, struct neighbour *neigh,
> > struct net_device *dev)
> > {
> > - struct l2t_entry *e;
> > - struct l2t_data *d = L2DATA(cdev);
> > + struct l2t_entry *e = NULL;
> > + struct l2t_data *d;
> > u32 addr = *(u32 *) neigh->primary_key;
> > int ifidx = neigh->dev->ifindex;
> > int hash = arp_hash(addr, ifidx, d);
> > ^
> > Uninitialized variable.
> >
> > struct port_info *p = netdev_priv(dev);
> > int smt_idx = p->port_id;
> >
> > + rcu_read_lock();
> > + d = L2DATA(cdev);
> > + if (!d)
> > + goto done_rcu;
> > +
> >
> > regards,
> > dan carpenter
> >
>
> Yup, thanks, you need this to9 fix the uninitalized var.
I rolled this into the original.
James
next prev parent reply other threads:[~2011-09-26 14:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-26 13:40 [SCSI] cxgb3i: convert cdev->l2opt to use rcu to prevent NULL dereference (v2) Dan Carpenter
2011-09-26 14:20 ` Neil Horman
2011-09-26 14:31 ` James Bottomley [this message]
2011-09-26 15:02 ` Neil Horman
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=1317047476.9560.0.camel@dabdike \
--to=james.bottomley@hansenpartnership.com \
--cc=dan.carpenter@oracle.com \
--cc=linux-scsi@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=nhorman@tuxdriver.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.