From: David Marchand Date: Sun, 1 Nov 2020 20:36:44 +0000 (+0100) Subject: eventdev: check input parameter for dump op X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=98ee07c20da2e40d197e5cd2d652bf591c3521e1;p=dpdk.git 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 --- 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;