From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by dpdk.org (Postfix) with ESMTP id 2057B1B1EA for ; Tue, 23 Oct 2018 03:50:42 +0200 (CEST) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Oct 2018 18:50:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,414,1534834800"; d="scan'208";a="94176988" Received: from dpdkx8602.sh.intel.com ([10.67.110.200]) by orsmga003.jf.intel.com with ESMTP; 22 Oct 2018 18:50:40 -0700 From: Rosen Xu To: dev@dpdk.org Cc: tianfei.zhang@intel.com, shreyansh.jain@nxp.com, hemant.agrawal@nxp.com, rosen.xu@intel.com, ferruh.yigit@intel.com Date: Tue, 23 Oct 2018 09:50:49 +0800 Message-Id: <1540259449-135300-1-git-send-email-rosen.xu@intel.com> X-Mailer: git-send-email 1.8.3.1 Subject: [dpdk-dev] [PATCH] drivers/raw/ifpga_rawdev: fix coverity issue 323508 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Oct 2018 01:50:43 -0000 This patch fixes rte_eal_hotplug_add without checking return value issue Signed-off-by: Rosen Xu 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); end: if (kvlist) @@ -591,7 +592,7 @@ if (name) free(name); - return 0; + return ret; } static int -- 1.8.3.1