DPDK patches and discussions
 help / color / mirror / Atom feed
From: Shreyansh Jain <shreyansh.jain@nxp.com>
To: Rosen Xu <rosen.xu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "tianfei.zhang@intel.com" <tianfei.zhang@intel.com>,
	Hemant Agrawal <hemant.agrawal@nxp.com>,
	"ferruh.yigit@intel.com" <ferruh.yigit@intel.com>
Subject: Re: [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508
Date: Tue, 23 Oct 2018 07:09:52 +0000	[thread overview]
Message-ID: <74cb8aff-f809-b999-8c2e-17f24599d827@nxp.com> (raw)
In-Reply-To: <1540259449-135300-1-git-send-email-rosen.xu@intel.com>

Besides the comment I sent before about 'Fixes' before sign-off, a 
single trivial comment inline ...

On Tuesday 23 October 2018 07:20 AM, Rosen Xu wrote:
> This patch fixes rte_eal_hotplug_add without checking return value issue
> 
> Signed-off-by: Rosen Xu <rosen.xu@intel.com>
> Fixes: ef1e8ede3da5 ("raw/ifpga: add Intel FPGA bus rawdev driver")
> Cc: rosen.xu@intel.com
> ---
>   drivers/raw/ifpga_rawdev/ifpga_rawdev.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
> index 3fed057..32e318f 100644
> --- a/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga_rawdev/ifpga_rawdev.c
> @@ -542,6 +542,7 @@
>   	int port;
>   	char *name = NULL;
>   	char dev_name[RTE_RAWDEV_NAME_MAX_LEN];
> +	int ret = -1;
>   
>   	devargs = dev->device.devargs;
>   
> @@ -583,7 +584,7 @@
>   	snprintf(dev_name, RTE_RAWDEV_NAME_MAX_LEN, "%d|%s",
>   	port, name);
>   
> -	rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
> +	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
>   			dev_name, devargs->args);

Ideally, the function argument spreading on next line should start 
underneath the previous arguments - something like:

	ret = rte_eal_hotplug_add(RTE_STR(IFPGA_BUS_NAME),
				  dev_name, devargs->args);

But, in this file this is not being done at multiple places (for 
example, the snprintf in this code snippet). So, either you can ignore 
this comment, or fix it for just this change.

>   end:
>   	if (kvlist)
> @@ -591,7 +592,7 @@
>   	if (name)
>   		free(name);
>   
> -	return 0;
> +	return ret;
>   }
>   
>   static int
> 

Otherwise, the patch is simple enough.

Acked-by: Shreyansh Jain <shreyansh.jain@nxp.com>

  parent reply	other threads:[~2018-10-23  7:09 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-23  1:50 Rosen Xu
2018-10-23  6:59 ` Shreyansh Jain
2018-10-23  7:09 ` Shreyansh Jain [this message]
2018-10-23  9:51   ` Ferruh Yigit
2018-10-23 10:43     ` Shreyansh Jain
2018-10-23 12:14       ` Ferruh Yigit
2018-10-25 10:25   ` Ferruh Yigit
2018-10-25 12:49     ` Xu, Rosen

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=74cb8aff-f809-b999-8c2e-17f24599d827@nxp.com \
    --to=shreyansh.jain@nxp.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=rosen.xu@intel.com \
    --cc=tianfei.zhang@intel.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).