[dpdk-dev] [PATCH] eventdev: check input parameter for dump op

Jerin Jacob jerinjacobk at gmail.com
Mon Nov 2 15:04:15 CET 2020


On Mon, Nov 2, 2020 at 2:22 AM McDaniel, Timothy
<timothy.mcdaniel at intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: David Marchand <david.marchand at redhat.com>
> > Sent: Sunday, November 1, 2020 2:37 PM
> > To: dev at dpdk.org
> > Cc: McDaniel, Timothy <timothy.mcdaniel at intel.com>; Jerin Jacob
> > <jerinj at 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.marchand at redhat.com>

Applied to dpdk-next-eventdev/for-main. Thanks.



> > ---
> >  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.mcdaniel at intel.com>


More information about the dev mailing list