From patchwork Thu May 7 03:11:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 69894 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 8FFD4A00C5; Thu, 7 May 2020 05:11:56 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2AF781D9BB; Thu, 7 May 2020 05:11:49 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id 6C1E51D942 for ; Thu, 7 May 2020 05:11:47 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id A4D2E30C060; Wed, 6 May 2020 20:11:13 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com A4D2E30C060 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1588821073; bh=qOvce0c2qNrGhcQqcCVTRqGnXU5Fvou3YEJrX19Y+aE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wfe03YYl01mfDvRhcPRyCyAJjPkU8ux+b/wGg275Sbt/ZMCn4G2+0yFo1yALBXkUD PBytTCwPl5NR4axUhN+PO1lf0aZzg2OKAIDDfuvf0oA6945GxpBsWfTRuL5hTsvKJC mqQW0hjlqM8oUpAyvkmfMFVG/J1y/UxtdtdYn16E= Received: from localhost.localdomain (unknown [10.230.26.175]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id C815A140069; Wed, 6 May 2020 20:11:45 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Kishore Padmanabha , Michael Baucom Date: Wed, 6 May 2020 20:11:35 -0700 Message-Id: <20200507031136.46035-2-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200507031136.46035-1-ajit.khaparde@broadcom.com> References: <20200505191738.58219-1-ajit.khaparde@broadcom.com> <20200507031136.46035-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 1/2] net/bnxt: fix overrun of the ulp device params array 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Kishore Padmanabha Fix a buffer overrun issue spotted by coverity while accessing the array ulp_device_params. Note that the issue was observed in an internal Coverity scan. Fixes: 313ac35ac701 ("net/bnxt: support ULP session manager init") Signed-off-by: Kishore Padmanabha Reviewed-by: Michael Baucom Reviewed-by: Ajit Khaparde --- drivers/net/bnxt/tf_ulp/ulp_template_db.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_ulp/ulp_template_db.c b/drivers/net/bnxt/tf_ulp/ulp_template_db.c index 86384169f..e89aefad4 100644 --- a/drivers/net/bnxt/tf_ulp/ulp_template_db.c +++ b/drivers/net/bnxt/tf_ulp/ulp_template_db.c @@ -321,7 +321,7 @@ struct bnxt_ulp_def_ident_info ulp_def_ident_tbl[] = { } }; -struct bnxt_ulp_device_params ulp_device_params[] = { +struct bnxt_ulp_device_params ulp_device_params[BNXT_ULP_DEVICE_ID_LAST] = { [BNXT_ULP_DEVICE_ID_WH_PLUS] = { .global_fid_enable = BNXT_ULP_SYM_YES, .byte_order = (enum bnxt_ulp_byte_order) From patchwork Thu May 7 03:11:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajit Khaparde X-Patchwork-Id: 69895 X-Patchwork-Delegate: ajit.khaparde@broadcom.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 7E30DA00C5; Thu, 7 May 2020 05:12:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id B31351DA02; Thu, 7 May 2020 05:11:50 +0200 (CEST) Received: from rnd-relay.smtp.broadcom.com (rnd-relay.smtp.broadcom.com [192.19.229.170]) by dpdk.org (Postfix) with ESMTP id EC6F21D95D for ; Thu, 7 May 2020 05:11:47 +0200 (CEST) Received: from mail-irv-17.broadcom.com (mail-irv-17.lvn.broadcom.net [10.75.242.48]) by rnd-relay.smtp.broadcom.com (Postfix) with ESMTP id 0C6A130C061; Wed, 6 May 2020 20:11:14 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.10.3 rnd-relay.smtp.broadcom.com 0C6A130C061 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=broadcom.com; s=dkimrelay; t=1588821074; bh=aEIcAiaMAlUUwNWA4EJ9DxX0DS2vilmXB415CMuvcL0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vljSksZoD2wCjziU16O9Oc/IcnDk9dReAk+a8c+sAVgWRHFvwQ0bsWLgXyg8bjKZt YLR8EOgJBf/N9ZF7qQUCDZvyzb/E+D3fjI+CGm8/6nTaV8A0WKm84aA+hhelIid/zV 5aNPUv8dR6wOJXcYX37JXCJEMSS5GRJ1LAEBm7S8= Received: from localhost.localdomain (unknown [10.230.26.175]) by mail-irv-17.broadcom.com (Postfix) with ESMTP id 4628814008E; Wed, 6 May 2020 20:11:46 -0700 (PDT) From: Ajit Khaparde To: dev@dpdk.org Cc: Somnath Kotur , Randy Schacher Date: Wed, 6 May 2020 20:11:36 -0700 Message-Id: <20200507031136.46035-3-ajit.khaparde@broadcom.com> X-Mailer: git-send-email 2.21.1 (Apple Git-122.3) In-Reply-To: <20200507031136.46035-1-ajit.khaparde@broadcom.com> References: <20200505191738.58219-1-ajit.khaparde@broadcom.com> <20200507031136.46035-1-ajit.khaparde@broadcom.com> MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v2 2/2] net/bnxt: fix uninitialized variable error 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Fix uninitialized variable error reported by coverity. Fixes: d33b68154fa4 ("net/bnxt: add tf_core table scope support") Coverity issue: 357771 Signed-off-by: Ajit Khaparde Reviewed-by: Somnath Kotur Reviewed-by: Randy Schacher --- drivers/net/bnxt/tf_core/tf_tbl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/bnxt/tf_core/tf_tbl.c b/drivers/net/bnxt/tf_core/tf_tbl.c index 93f387e86..d900c9c09 100644 --- a/drivers/net/bnxt/tf_core/tf_tbl.c +++ b/drivers/net/bnxt/tf_core/tf_tbl.c @@ -539,7 +539,7 @@ tf_em_ctx_reg(struct tf *tfp, { struct tf_em_ctx_mem_info *ctxp = &tbl_scope_cb->em_ctx_info[dir]; struct tf_em_table *tbl; - int rc; + int rc = 0; int i; for (i = KEY0_TABLE; i < MAX_TABLE; i++) {