From: Shijith Thotton <shijith.thotton@caviumnetworks.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: dev@dpdk.org
Subject: [dpdk-dev] [PATCH 2/2] net/liquidio: fix null pointer check
Date: Mon, 10 Apr 2017 11:56:07 +0530 [thread overview]
Message-ID: <1491805567-10743-2-git-send-email-shijith.thotton@caviumnetworks.com> (raw)
In-Reply-To: <1491805567-10743-1-git-send-email-shijith.thotton@caviumnetworks.com>
Fix null pointer check in release Rx/Tx queue APIs.
Reported by Coverity scan:
1423923 Dereference before null check
1423924 Dereference before null check
Fixes: 9a30013b9884 ("net/liquidio: add API to release Rx queue")
Fixes: cf6bfcbea178 ("net/liquidio: add API to release Tx queue")
Signed-off-by: Shijith Thotton <shijith.thotton@caviumnetworks.com>
---
drivers/net/liquidio/lio_ethdev.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/net/liquidio/lio_ethdev.c b/drivers/net/liquidio/lio_ethdev.c
index df91659..a65c749 100644
--- a/drivers/net/liquidio/lio_ethdev.c
+++ b/drivers/net/liquidio/lio_ethdev.c
@@ -1155,14 +1155,13 @@ struct rte_lio_xstats_name_off {
lio_dev_rx_queue_release(void *rxq)
{
struct lio_droq *droq = rxq;
- struct lio_device *lio_dev = droq->lio_dev;
int oq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
+ if (droq) {
+ /* Run time queue deletion not supported */
+ if (droq->lio_dev->port_configured)
+ return;
- if (droq != NULL) {
oq_no = droq->q_no;
lio_delete_droq_queue(droq->lio_dev, oq_no);
}
@@ -1250,14 +1249,14 @@ struct rte_lio_xstats_name_off {
lio_dev_tx_queue_release(void *txq)
{
struct lio_instr_queue *tq = txq;
- struct lio_device *lio_dev = tq->lio_dev;
uint32_t fw_mapped_iq_no;
- /* Run time queue deletion not supported */
- if (lio_dev->port_configured)
- return;
- if (tq != NULL) {
+ if (tq) {
+ /* Run time queue deletion not supported */
+ if (tq->lio_dev->port_configured)
+ return;
+
/* Free sg_list */
lio_delete_sglist(tq);
--
1.8.3.1
next prev parent reply other threads:[~2017-04-10 6:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-10 6:26 [dpdk-dev] [PATCH 1/2] net/liquidioi/base: fix mbox command initialization Shijith Thotton
2017-04-10 6:26 ` Shijith Thotton [this message]
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: " Shijith Thotton
2017-04-10 7:18 ` [dpdk-dev] [PATCH v2 2/2] net/liquidio: fix null pointer check Shijith Thotton
2017-04-10 10:07 ` [dpdk-dev] [PATCH v2 1/2] net/liquidio/base: fix mbox command initialization Ferruh Yigit
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=1491805567-10743-2-git-send-email-shijith.thotton@caviumnetworks.com \
--to=shijith.thotton@caviumnetworks.com \
--cc=dev@dpdk.org \
--cc=ferruh.yigit@intel.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;
as well as URLs for NNTP newsgroup(s).