From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E6C8BA034E; Mon, 21 Feb 2022 07:38:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7732F4068C; Mon, 21 Feb 2022 07:38:08 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 58B6D40395; Mon, 21 Feb 2022 07:38:06 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1645425486; x=1676961486; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=6zCyDq4FG73XzICdx/Pvy5lf3avvQhGbOQhkBCcLTcM=; b=QcIAGbYMBkRl0hkilFSGNytrXNdOTJ8b/Tpb3FKlGK25g3riVzZyJw0u OXSqWmMy9k13NDsGXfc9fFTx+m4yBYrBVAaPj8YCPiTwzAgTL6lehMces c+O5zLpFpX7n6kMgQzmz+roF8ui92AlMCJFtf092uLSZ+88wgS0vEYsGy uqgwDGwe1XxHGZ/NM3b9OxZSTdgSXj2+1i9/cVfRDisEsm5ESVdwobgsa 67LaVghGta1MaNNufVZUVkr4xJza2NeRRZcvPTMigJB8Y/xwMqKWCXAHO u4QBjP1YeEY6MtDT77+L6bJqJU9ycXv4n/t+TK9aQ6kyV6nJFpmKTiXYu w==; X-IronPort-AV: E=McAfee;i="6200,9189,10264"; a="251628670" X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="251628670" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Feb 2022 22:38:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,385,1635231600"; d="scan'208";a="778603987" Received: from unknown (HELO localhost.localdomain.sh.intel.com) ([10.238.175.107]) by fmsmga005.fm.intel.com with ESMTP; 20 Feb 2022 22:38:01 -0800 From: Wei Huang 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 Subject: [PATCH v4] raw/ifpga: initialize scalar variable before using Date: Mon, 21 Feb 2022 01:34:44 -0500 Message-Id: <20220221063444.305376-1-wei.huang@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220221022019.303075-1-wei.huang@intel.com> References: <20220221022019.303075-1-wei.huang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org 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 --- 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