DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] eventdev: check input parameter for dump op
@ 2020-11-01 20:36 David Marchand
  2020-11-01 20:52 ` McDaniel, Timothy
  0 siblings, 1 reply; 3+ messages in thread
From: David Marchand @ 2020-11-01 20:36 UTC (permalink / raw)
  To: dev; +Cc: timothy.mcdaniel, Jerin Jacob

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-11-02 14:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-01 20:36 [dpdk-dev] [PATCH] eventdev: check input parameter for dump op David Marchand
2020-11-01 20:52 ` McDaniel, Timothy
2020-11-02 14:04   ` Jerin Jacob

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).