From: "McDaniel, Timothy" <timothy.mcdaniel@intel.com>
To: David Marchand <david.marchand@redhat.com>,
"dev@dpdk.org" <dev@dpdk.org>
Cc: Jerin Jacob <jerinj@marvell.com>
Subject: Re: [dpdk-dev] [PATCH] eventdev: check input parameter for dump op
Date: Sun, 1 Nov 2020 20:52:03 +0000 [thread overview]
Message-ID: <SN6PR11MB31039B0C23AAE73F9CFC4F529E130@SN6PR11MB3103.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20201101203644.1697-1-david.marchand@redhat.com>
> -----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>
next prev parent reply other threads:[~2020-11-01 20:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-01 20:36 David Marchand
2020-11-01 20:52 ` McDaniel, Timothy [this message]
2020-11-02 14:04 ` Jerin Jacob
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=SN6PR11MB31039B0C23AAE73F9CFC4F529E130@SN6PR11MB3103.namprd11.prod.outlook.com \
--to=timothy.mcdaniel@intel.com \
--cc=david.marchand@redhat.com \
--cc=dev@dpdk.org \
--cc=jerinj@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).