linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Iyappan Subramanian <isubramanian@apm.com>
To: Colin King <colin.king@canonical.com>
Cc: Keyur Chudgar <kchudgar@apm.com>, netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers: net: xgene: initialize slots
Date: Thu, 8 Dec 2016 10:44:31 -0800	[thread overview]
Message-ID: <CAKh23Fk5c48O_ddCZ=OTimdiA1_-F-j5U1H8c+OrcQHnzOsJaQ@mail.gmail.com> (raw)
In-Reply-To: <20161208111754.9711-1-colin.king@canonical.com>

On Thu, Dec 8, 2016 at 3:17 AM, Colin King <colin.king@canonical.com> wrote:
> From: Colin Ian King <colin.king@canonical.com>
>
> static analysis using cppcheck detected that slots was uninitialized.
> Fix this by initializing it to buf_pool->slots - 1
>
> Found using static analysis with CoverityScan, CID #1387620
>
> Fixes: a9380b0f7be818 ("drivers: net: xgene: Add support for Jumbo frame")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/net/ethernet/apm/xgene/xgene_enet_main.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
> index 6c7eea8..899163c 100644
> --- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
> +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
> @@ -636,6 +636,7 @@ static void xgene_enet_free_pagepool(struct xgene_enet_desc_ring *buf_pool,
>
>         dev = ndev_to_dev(buf_pool->ndev);
>         head = buf_pool->head;
> +       slots = buf_pool->slots - 1;
>
>         for (i = 0; i < 4; i++) {
>                 frag_size = xgene_enet_get_data_len(le64_to_cpu(desc[i ^ 1]));

Thanks, Colin.

Dan Carpenter <dan.carpenter@oracle.com> posted the fix already and
got accepted.
http://marc.info/?l=linux-netdev&m=148110980224343&w=2

> --
> 2.10.2
>

      reply	other threads:[~2016-12-08 18:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-08 11:17 [PATCH] drivers: net: xgene: initialize slots Colin King
2016-12-08 18:44 ` Iyappan Subramanian [this message]

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='CAKh23Fk5c48O_ddCZ=OTimdiA1_-F-j5U1H8c+OrcQHnzOsJaQ@mail.gmail.com' \
    --to=isubramanian@apm.com \
    --cc=colin.king@canonical.com \
    --cc=kchudgar@apm.com \
    --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).