DPDK patches and discussions
 help / color / mirror / Atom feed
* [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

DPDK patches and discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.dpdk.org/dev/0 dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dev dev/ http://inbox.dpdk.org/dev \
		dev@dpdk.org
	public-inbox-index dev

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git