public inbox for linux-tegra@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Julian Andres Klode <jak@jak-linux.org>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	kernel-janitors@vger.kernel.org,
	Rob Herring <rob.herring@calxeda.com>,
	Grant Likely <grant.likely@linaro.org>,
	linux-tegra@vger.kernel.org, ac100@lists.launchpad.net
Subject: Re: [patch] staging: nvec: potential NULL dereference on error path
Date: Thu, 7 Nov 2013 14:22:10 +0300	[thread overview]
Message-ID: <20131107112210.GU26669@mwanda> (raw)
In-Reply-To: <CAEA6rAzT2eZ-VGUP8gSjNbooKCdkxnixO-nEFA_hPcrUjWR4UQ@mail.gmail.com>

On Thu, Nov 07, 2013 at 12:10:14PM +0100, Julian Andres Klode wrote:
> (Replying to all now)
> 
> On Thu, Nov 7, 2013 at 8:54 AM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> > We assume nvec->rx can be NULL earlier so I have added a check here as
> > well.
> >
> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> >
> > diff --git a/drivers/staging/nvec/nvec.c b/drivers/staging/nvec/nvec.c
> > index 3066ee2..c64e069 100644
> > --- a/drivers/staging/nvec/nvec.c
> > +++ b/drivers/staging/nvec/nvec.c
> > @@ -681,7 +681,8 @@ static irqreturn_t nvec_interrupt(int irq, void *dev)
> >                         dev_err(nvec->dev,
> >                                 "RX buffer overflow on %p: "
> >                                 "Trying to write byte %u of %u\n",
> > -                               nvec->rx, nvec->rx->pos, NVEC_MSG_SIZE);
> > +                               nvec->rx, nvec->rx ? nvec->rx->pos : -1,
> > +                               NVEC_MSG_SIZE);
> >                 break;
> >         default:
> >                 nvec->state = 0;
> 
> In the TX case, we print 0 if nvec->tx is NULL, so using -1 if
> nvec->rx is NULL would be inconsistent.

Ok.  I will resend.

regards,
dan carpenter

  reply	other threads:[~2013-11-07 11:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-07  7:54 [patch] staging: nvec: potential NULL dereference on error path Dan Carpenter
2013-11-07 11:10 ` Julian Andres Klode
2013-11-07 11:22   ` Dan Carpenter [this message]
2013-11-07 11:25   ` [patch v2] " Dan Carpenter

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=20131107112210.GU26669@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=ac100@lists.launchpad.net \
    --cc=devel@driverdev.osuosl.org \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jak@jak-linux.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=rob.herring@calxeda.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