> -----Original Message-----
> From: Huang, Wei <wei.hu...@intel.com>
> Sent: Monday, February 21, 2022 3:52 PM
> To: dev@dpdk.org; Xu, Rosen <rosen...@intel.com>; Zhang, Qi Z
> <qi.z.zh...@intel.com>; nipun.gu...@nxp.com; hemant.agra...@nxp.com
> Cc: sta...@dpdk.org; Zhang, Tianfei <tianfei.zh...@intel.com>; Yigit, Ferruh
> <ferruh.yi...@intel.com>; Huang, Wei <wei.hu...@intel.com>
> Subject: [PATCH v5] raw/ifpga: initialize scalar variable before using
> 
> Scalar variable sub_brg_bdf may be used uninitialized in function
> ifpga_rawdev_fill_info(). It is initialized now in this fix.
> 
> Coverity issue: 375805
> Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
> Cc: sta...@dpdk.org
> 
> Signed-off-by: Wei Huang <wei.hu...@intel.com>
> ---
> v2: add space after comma to meet coding style requirement
> ---
> v3: refine log
> ---
> v4: add coverity issue id
> ---
> v5: use simple initializer
> ---
>  drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/raw/ifpga/ifpga_rawdev.c
> b/drivers/raw/ifpga/ifpga_rawdev.c
> index b73512d..6beecb7 100644
> --- a/drivers/raw/ifpga/ifpga_rawdev.c
> +++ b/drivers/raw/ifpga/ifpga_rawdev.c
> @@ -216,7 +216,7 @@ static int ifpga_rawdev_fill_info(struct ifpga_rawdev
> *ifpga_dev,
>       char dir[1024] = "/sys/devices/";
>       char *c;
>       int ret;
> -     char sub_brg_bdf[4][16];
> +     char sub_brg_bdf[4][16] = {{0}};
>       int point;
>       DIR *dp = NULL;
>       struct dirent *entry;
> --

It looks good for me.

Acked-by: Tianfei Zhang <tianfei.zh...@intel.com>

> 1.8.3.1

Reply via email to