All of lore.kernel.org
 help / color / mirror / Atom feed
From: Harman Kalra <hkalra@marvell.com>
To: Jerin Jacob <jerinj@marvell.com>
Cc: <dev@dpdk.org>, Harman Kalra <hkalra@marvell.com>
Subject: [dpdk-dev] [PATCH] event/octeontx: fix memory corruption
Date: Fri, 15 May 2020 16:51:24 +0530	[thread overview]
Message-ID: <1589541684-23246-1-git-send-email-hkalra@marvell.com> (raw)

Since PMD enqueues a single event at a time, fixing the issue by
passing 1 rather than nb_events to avoid any out of bound access as
reported by coverity.

Coverity issue: 358447
Fixes: 56a96aa42464 ("event/octeontx: add framework for Rx/Tx offloads")

Signed-off-by: Harman Kalra <hkalra@marvell.com>
---
 drivers/event/octeontx/ssovf_worker.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/event/octeontx/ssovf_worker.c b/drivers/event/octeontx/ssovf_worker.c
index d2d5eea8f..18b7926e8 100644
--- a/drivers/event/octeontx/ssovf_worker.c
+++ b/drivers/event/octeontx/ssovf_worker.c
@@ -282,6 +282,7 @@ __sso_event_tx_adapter_enqueue(void *port, struct rte_event ev[],
 	struct ssows *ws = port;
 	struct octeontx_txq *txq;
 
+	RTE_SET_USED(nb_events);
 	switch (ev->sched_type) {
 	case SSO_SYNC_ORDERED:
 		ssows_swtag_norm(ws, ev->event, SSO_SYNC_ATOMIC);
@@ -305,7 +306,7 @@ __sso_event_tx_adapter_enqueue(void *port, struct rte_event ev[],
 	ethdev = &rte_eth_devices[port_id];
 	txq = ethdev->data->tx_queues[queue_id];
 
-	return __octeontx_xmit_pkts(txq, &m, nb_events, cmd, flag);
+	return __octeontx_xmit_pkts(txq, &m, 1, cmd, flag);
 }
 
 #define T(name, f3, f2, f1, f0, sz, flags)				     \
-- 
2.18.0


             reply	other threads:[~2020-05-15 11:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-15 11:21 Harman Kalra [this message]
2020-05-15 14:36 ` [dpdk-dev] [PATCH] event/octeontx: fix memory corruption Jerin Jacob

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=1589541684-23246-1-git-send-email-hkalra@marvell.com \
    --to=hkalra@marvell.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.