DPDK patches and discussions
 help / color / mirror / Atom feed
* [PATCH v1] raw/ifpga: initialize scalar variable before using
@ 2022-02-18  3:09 Wei Huang
  2022-02-18  3:20 ` [PATCH v2] " Wei Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Huang @ 2022-02-18  3:09 UTC (permalink / raw)
  To: dev, rosen.xu, qi.z.zhang, nipun.gupta, hemant.agrawal
  Cc: stable, tianfei.zhang, ferruh.yigit, Wei Huang

Scalar variable sub_brg_bdf may be used uninitialized in function
ifpga_rawdev_fill_info(), this fix initialize it.

Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@intel.com>
---
 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..b02eb23 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},{0},{0},{0}};
 	int point;
 	DIR *dp = NULL;
 	struct dirent *entry;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] raw/ifpga: initialize scalar variable before using
  2022-02-18  3:09 [PATCH v1] raw/ifpga: initialize scalar variable before using Wei Huang
@ 2022-02-18  3:20 ` Wei Huang
  2022-02-21  2:20   ` [PATCH v3] " Wei Huang
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Huang @ 2022-02-18  3:20 UTC (permalink / raw)
  To: dev, rosen.xu, qi.z.zhang, nipun.gupta, hemant.agrawal
  Cc: stable, tianfei.zhang, ferruh.yigit, Wei Huang

Scalar variable sub_brg_bdf may be used uninitialized in function
ifpga_rawdev_fill_info(), this fix initialize it.

Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@intel.com>
---
v2: add space after comma to meet coding style requirement
---
 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..c133a94 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}, {0}, {0}, {0}};
 	int point;
 	DIR *dp = NULL;
 	struct dirent *entry;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3] raw/ifpga: initialize scalar variable before using
  2022-02-18  3:20 ` [PATCH v2] " Wei Huang
@ 2022-02-21  2:20   ` Wei Huang
  2022-02-21  2:46     ` Xu, Rosen
  2022-02-21  6:34     ` [PATCH v4] " Wei Huang
  0 siblings, 2 replies; 8+ messages in thread
From: Wei Huang @ 2022-02-21  2:20 UTC (permalink / raw)
  To: dev, rosen.xu, qi.z.zhang, nipun.gupta, hemant.agrawal
  Cc: stable, tianfei.zhang, ferruh.yigit, Wei Huang

Scalar variable sub_brg_bdf may be used uninitialized in function
ifpga_rawdev_fill_info(). It is initialized now in this fix.

Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
Cc: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@intel.com>
---
v2: add space after comma to meet coding style requirement
---
v3: refine log
---
 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..c133a94 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}, {0}, {0}, {0}};
 	int point;
 	DIR *dp = NULL;
 	struct dirent *entry;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v3] raw/ifpga: initialize scalar variable before using
  2022-02-21  2:20   ` [PATCH v3] " Wei Huang
@ 2022-02-21  2:46     ` Xu, Rosen
  2022-02-21  6:34     ` [PATCH v4] " Wei Huang
  1 sibling, 0 replies; 8+ messages in thread
From: Xu, Rosen @ 2022-02-21  2:46 UTC (permalink / raw)
  To: Huang, Wei, dev, Zhang,  Qi Z, nipun.gupta, hemant.agrawal
  Cc: stable, Zhang, Tianfei, Yigit, Ferruh

Hi,

> -----Original Message-----
> From: Huang, Wei <wei.huang@intel.com>
> Sent: Monday, February 21, 2022 10:20
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; nipun.gupta@nxp.com; hemant.agrawal@nxp.com
> Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Huang, Wei <wei.huang@intel.com>
> Subject: [PATCH v3] 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.
> 
> Fixes: 9c006c45d0c5 ("raw/ifpga: scan PCIe BDF device tree")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Wei Huang <wei.huang@intel.com>
> ---
> v2: add space after comma to meet coding style requirement
> ---
> v3: refine log
> ---
>  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..c133a94 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}, {0}, {0}, {0}};
>  	int point;
>  	DIR *dp = NULL;
>  	struct dirent *entry;
> --
> 1.8.3.1

Acked-by: Rosen Xu <rosen.xu@intel.com>


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v4] raw/ifpga: initialize scalar variable before using
  2022-02-21  2:20   ` [PATCH v3] " Wei Huang
  2022-02-21  2:46     ` Xu, Rosen
@ 2022-02-21  6:34     ` Wei Huang
  2022-02-21  7:52       ` [PATCH v5] " Wei Huang
  1 sibling, 1 reply; 8+ messages in thread
From: Wei Huang @ 2022-02-21  6:34 UTC (permalink / raw)
  To: dev, rosen.xu, qi.z.zhang, nipun.gupta, hemant.agrawal
  Cc: stable, tianfei.zhang, ferruh.yigit, Wei Huang

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: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@intel.com>
---
v2: add space after comma to meet coding style requirement
---
v3: refine log
---
v4: add coverity issue id
---
 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..c133a94 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}, {0}, {0}, {0}};
 	int point;
 	DIR *dp = NULL;
 	struct dirent *entry;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v5] raw/ifpga: initialize scalar variable before using
  2022-02-21  6:34     ` [PATCH v4] " Wei Huang
@ 2022-02-21  7:52       ` Wei Huang
  2022-02-28  7:58         ` Zhang, Tianfei
  0 siblings, 1 reply; 8+ messages in thread
From: Wei Huang @ 2022-02-21  7:52 UTC (permalink / raw)
  To: dev, rosen.xu, qi.z.zhang, nipun.gupta, hemant.agrawal
  Cc: stable, tianfei.zhang, ferruh.yigit, Wei Huang

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: stable@dpdk.org

Signed-off-by: Wei Huang <wei.huang@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;
-- 
1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: [PATCH v5] raw/ifpga: initialize scalar variable before using
  2022-02-21  7:52       ` [PATCH v5] " Wei Huang
@ 2022-02-28  7:58         ` Zhang, Tianfei
  2022-03-07 22:13           ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Zhang, Tianfei @ 2022-02-28  7:58 UTC (permalink / raw)
  To: Huang, Wei, dev, Xu, Rosen, Zhang, Qi Z, nipun.gupta, hemant.agrawal
  Cc: stable, Yigit, Ferruh



> -----Original Message-----
> From: Huang, Wei <wei.huang@intel.com>
> Sent: Monday, February 21, 2022 3:52 PM
> To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> <qi.z.zhang@intel.com>; nipun.gupta@nxp.com; hemant.agrawal@nxp.com
> Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit, Ferruh
> <ferruh.yigit@intel.com>; Huang, Wei <wei.huang@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: stable@dpdk.org
> 
> Signed-off-by: Wei Huang <wei.huang@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.zhang@intel.com>

> 1.8.3.1


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v5] raw/ifpga: initialize scalar variable before using
  2022-02-28  7:58         ` Zhang, Tianfei
@ 2022-03-07 22:13           ` Thomas Monjalon
  0 siblings, 0 replies; 8+ messages in thread
From: Thomas Monjalon @ 2022-03-07 22:13 UTC (permalink / raw)
  To: Huang, Wei, Zhang, Tianfei
  Cc: dev, Xu, Rosen, Zhang, Qi Z, nipun.gupta, hemant.agrawal, stable,
	Yigit, Ferruh

28/02/2022 08:58, Zhang, Tianfei:
> From: Huang, Wei <wei.huang@intel.com>
> > Sent: Monday, February 21, 2022 3:52 PM
> > To: dev@dpdk.org; Xu, Rosen <rosen.xu@intel.com>; Zhang, Qi Z
> > <qi.z.zhang@intel.com>; nipun.gupta@nxp.com; hemant.agrawal@nxp.com
> > Cc: stable@dpdk.org; Zhang, Tianfei <tianfei.zhang@intel.com>; Yigit, Ferruh
> > <ferruh.yigit@intel.com>; Huang, Wei <wei.huang@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: stable@dpdk.org
> > 
> > Signed-off-by: Wei Huang <wei.huang@intel.com>
> 
> It looks good for me.
> 
> Acked-by: Tianfei Zhang <tianfei.zhang@intel.com>

Applied, thanks.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-03-07 22:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-18  3:09 [PATCH v1] raw/ifpga: initialize scalar variable before using Wei Huang
2022-02-18  3:20 ` [PATCH v2] " Wei Huang
2022-02-21  2:20   ` [PATCH v3] " Wei Huang
2022-02-21  2:46     ` Xu, Rosen
2022-02-21  6:34     ` [PATCH v4] " Wei Huang
2022-02-21  7:52       ` [PATCH v5] " Wei Huang
2022-02-28  7:58         ` Zhang, Tianfei
2022-03-07 22:13           ` Thomas Monjalon

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).