From 98ee07c20da2e40d197e5cd2d652bf591c3521e1 Mon Sep 17 00:00:00 2001 From: David Marchand Date: Sun, 1 Nov 2020 21:36:44 +0100 Subject: [PATCH] eventdev: check input parameter for dump op Rather than have drivers check for this, let's ensure the passed FILE * is not NULL. Signed-off-by: David Marchand Reviewed-by: Timothy McDaniel --- 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.20.1