* [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
* Re: [dpdk-dev] [PATCH] eventdev: check input parameter for dump op
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
0 siblings, 1 reply; 3+ messages in thread
From: McDaniel, Timothy @ 2020-11-01 20:52 UTC (permalink / raw)
To: David Marchand, dev; +Cc: Jerin Jacob
> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Sunday, November 1, 2020 2:37 PM
> To: dev@dpdk.org
> Cc: McDaniel, Timothy <timothy.mcdaniel@intel.com>; Jerin Jacob
> <jerinj@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@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.mcdaniel@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [dpdk-dev] [PATCH] eventdev: check input parameter for dump op
2020-11-01 20:52 ` McDaniel, Timothy
@ 2020-11-02 14:04 ` Jerin Jacob
0 siblings, 0 replies; 3+ messages in thread
From: Jerin Jacob @ 2020-11-02 14:04 UTC (permalink / raw)
To: McDaniel, Timothy; +Cc: David Marchand, dev, Jerin Jacob
On Mon, Nov 2, 2020 at 2:22 AM McDaniel, Timothy
<timothy.mcdaniel@intel.com> wrote:
>
>
>
> > -----Original Message-----
> > From: David Marchand <david.marchand@redhat.com>
> > Sent: Sunday, November 1, 2020 2:37 PM
> > To: dev@dpdk.org
> > Cc: McDaniel, Timothy <timothy.mcdaniel@intel.com>; Jerin Jacob
> > <jerinj@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@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@intel.com>
^ 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).