DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: dev@dpdk.org
Cc: timothy.mcdaniel@intel.com, Jerin Jacob <jerinj@marvell.com>
Subject: [dpdk-dev] [PATCH] eventdev: check input parameter for dump op
Date: Sun,  1 Nov 2020 21:36:44 +0100	[thread overview]
Message-ID: <20201101203644.1697-1-david.marchand@redhat.com> (raw)

Rather than have drivers check for this, let's ensure the passed FILE *
is not NULL.

Signed-off-by: David Marchand <david.marchand@redhat.com>
---
 lib/librte_eventdev/rte_eventdev.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/librte_eventdev/rte_eventdev.c b/lib/librte_eventdev/rte_eventdev.c
index 994bd1eaa9..afbadc535b 100644
--- a/lib/librte_eventdev/rte_eventdev.c
+++ b/lib/librte_eventdev/rte_eventdev.c
@@ -1153,6 +1153,8 @@ rte_event_dev_dump(uint8_t dev_id, FILE *f)
 	RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(dev_id, -EINVAL);
 	dev = &rte_eventdevs[dev_id];
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dump, -ENOTSUP);
+	if (f == NULL)
+		return -EINVAL;
 
 	(*dev->dev_ops->dump)(dev, f);
 	return 0;
-- 
2.23.0


             reply	other threads:[~2020-11-01 20:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01 20:36 David Marchand [this message]
2020-11-01 20:52 ` McDaniel, Timothy
2020-11-02 14:04   ` 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=20201101203644.1697-1-david.marchand@redhat.com \
    --to=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jerinj@marvell.com \
    --cc=timothy.mcdaniel@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).