All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Huang <wei.huang@intel.com>
To: dev@dpdk.org, rosen.xu@intel.com, qi.z.zhang@intel.com,
	nipun.gupta@nxp.com, hemant.agrawal@nxp.com
Cc: stable@dpdk.org, tianfei.zhang@intel.com, ferruh.yigit@intel.com,
	Wei Huang <wei.huang@intel.com>
Subject: [PATCH v2] raw/ifpga: initialize scalar variable before using
Date: Thu, 17 Feb 2022 22:20:53 -0500	[thread overview]
Message-ID: <20220218032053.266035-1-wei.huang@intel.com> (raw)
In-Reply-To: <20220218030910.265812-1-wei.huang@intel.com>

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


  reply	other threads:[~2022-02-18  3:24 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-18  3:09 [PATCH v1] raw/ifpga: initialize scalar variable before using Wei Huang
2022-02-18  3:20 ` Wei Huang [this message]
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

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=20220218032053.266035-1-wei.huang@intel.com \
    --to=wei.huang@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=hemant.agrawal@nxp.com \
    --cc=nipun.gupta@nxp.com \
    --cc=qi.z.zhang@intel.com \
    --cc=rosen.xu@intel.com \
    --cc=stable@dpdk.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.