> -----Original Message-----
> From: David Marchand <david.march...@redhat.com>
> Sent: Sunday, November 1, 2020 2:37 PM
> To: dev@dpdk.org
> Cc: McDaniel, Timothy <timothy.mcdan...@intel.com>; Jerin Jacob
> <jer...@marvell.com>
> 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 <david.march...@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

Looks good to me.

Reviewed-by: Timothy McDaniel <timothy.mcdan...@intel.com>

Reply via email to