From: Colin Ian King <colin.king@canonical.com>
To: Matteo Croce <mcroce@microsoft.com>,
Sven Auhagen <sven.auhagen@voleatech.de>
Cc: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: re: mvpp2: XDP TX support
Date: Mon, 6 Jul 2020 14:59:22 +0100 [thread overview]
Message-ID: <18eb549b-d2f6-9352-582e-aec484dc95c1@canonical.com> (raw)
Hi,
Static analysis with Coverity has found a potential issue in the
following commit:
commit c2d6fe6163de80d7f7cf400ee351f56d6cdb7a5a
Author: Matteo Croce <mcroce@microsoft.com>
Date: Thu Jul 2 16:12:43 2020 +0200
mvpp2: XDP TX support
In source drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c in function
mvpp2_check_pagepool_dma, analysis is as follows:
4486 if (!priv->percpu_pools)
4487 return err;
4488
CID (#1 of 1): Array compared against 0 (NO_EFFECT)
array_null: Comparing an array to null is not useful: priv->page_pool,
since the test will always evaluate as true.
Was priv->page_pool formerly declared as a pointer?
4489 if (!priv->page_pool)
4490 return -ENOMEM;
4491
page_pool is declared as:
struct page_pool *page_pool[MVPP2_PORT_MAX_RXQ];
..it is an array and hence cannot be null, so the null check is
redundant. Later on there is a reference of priv->page_pool[0], so was
the check meant to be:
if (!priv->page_pool[0])
Colin
next reply other threads:[~2020-07-06 13:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-06 13:59 Colin Ian King [this message]
2020-07-06 15:28 ` Matteo Croce
2020-07-06 15:32 ` Colin Ian King
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=18eb549b-d2f6-9352-582e-aec484dc95c1@canonical.com \
--to=colin.king@canonical.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mcroce@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=sven.auhagen@voleatech.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
all inboxes | Powered by JetHome®