From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Wolfram Sang <wsa@the-dreams.de>, netdev@vger.kernel.org
Cc: Simon Horman <horms@verge.net.au>, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] net: sh_eth: avoid NULL pointer dereference in ring setup
Date: Wed, 2 Mar 2016 19:47:05 +0300 [thread overview]
Message-ID: <56D71909.2020503@cogentembedded.com> (raw)
In-Reply-To: <1456932370-4143-1-git-send-email-wsa@the-dreams.de>
Hello.
On 03/02/2016 06:26 PM, Wolfram Sang wrote:
> From: Wolfram Sang <wsa+renesas@sang-engineering.com>
>
> When allocating an skb fails, rxdesc is still NULL (or the previous ring
> index on further iterations of the loop). However, this pointer is
> dereferenced after the loop.
This is intended. What we seem to actually need is a NULL check before
that dereference.
> So, make sure rxdesc is updated immediately
> at the beginning of the loop.
No, this seems wrong. We don't want an unfilled descriptor to be marked as
last, we still need the previous one marked as last. Actually, 'rxdesc'
shouldn't be "advanced" even before the second *break* as it is now.
> Reported-by: coverity (CID 1056464)
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Will you respin or should I?
MBR, Sergei
next prev parent reply other threads:[~2016-03-02 16:47 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-02 15:26 [PATCH] net: sh_eth: avoid NULL pointer dereference in ring setup Wolfram Sang
2016-03-02 16:47 ` Sergei Shtylyov [this message]
2016-03-02 17:11 ` Wolfram Sang
2016-03-02 17:47 ` Sergei Shtylyov
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=56D71909.2020503@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=horms@verge.net.au \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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).