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 9DAE2A034F for ; Tue, 1 Mar 2022 11:45:04 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 995D8407FF; Tue, 1 Mar 2022 11:45:04 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 5BD4C426EA for ; Tue, 1 Mar 2022 11:45:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646131502; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GFP8bhm62RI7vtBmQXmQco+/oVN6TWZUgdJQSiTWX8o=; b=bcqR/2+z4y39f2z2I3drmyTOzuV1wLhJ/8hx4jTu7nFVIBrqUBGeOiZ86O0/vChdqh4C1q M4Ght3AmlW6wqxOjY9yQ8JtJ8IuKMZGDqSO+D6X8Abx1uQsahPcExpa1720Ok0ZBhvWeTp mIO9q8wXoPWI4Sg0KJ+uJvtt1SkGDeA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-618-TXMW6NphOAmyzQnDarRPqw-1; Tue, 01 Mar 2022 05:44:58 -0500 X-MC-Unique: TXMW6NphOAmyzQnDarRPqw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id EEC36801AB2; Tue, 1 Mar 2022 10:44:57 +0000 (UTC) Received: from rh.Home (unknown [10.39.194.142]) by smtp.corp.redhat.com (Postfix) with ESMTP id F20AD6FB02; Tue, 1 Mar 2022 10:44:56 +0000 (UTC) From: Kevin Traynor To: Gowrishankar Muthukrishnan Cc: Jerin Jacob , dpdk stable Subject: patch 'common/cnxk: add missing checks of return values' has been queued to stable release 21.11.1 Date: Tue, 1 Mar 2022 10:42:08 +0000 Message-Id: <20220301104300.334382-52-ktraynor@redhat.com> In-Reply-To: <20220301104300.334382-1-ktraynor@redhat.com> References: <20220301104300.334382-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=ktraynor@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Hi, FYI, your patch has been queued to stable release 21.11.1 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 03/06/22. So please shout if anyone has objections. Also note that after the patch there's a diff of the upstream commit vs the patch applied to the branch. This will indicate if there was any rebasing needed to apply to the stable branch. If there were code changes for rebasing (ie: not only metadata diffs), please double check that the rebase was correctly done. Queued patches are on a temporary branch at: https://github.com/kevintraynor/dpdk-stable This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable/commit/7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58 Thanks. Kevin --- >From 7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58 Mon Sep 17 00:00:00 2001 From: Gowrishankar Muthukrishnan Date: Sat, 12 Feb 2022 18:08:18 +0530 Subject: [PATCH] common/cnxk: add missing checks of return values [ upstream commit 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 ] This patch fixes coverity issue by adding checks on return values. Coverity issue: 373628, 374858, 370213, 370215 Fixes: af75aac78978 ("common/cnxk: support telemetry for NIX") Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle") Fixes: fcdef46b6698 ("common/cnxk: support NIX TM debug and misc utils") Fixes: df405df95eeb ("common/cnxk: add NIX TM helper to alloc/free resource") Signed-off-by: Gowrishankar Muthukrishnan Acked-by: Jerin Jacob --- drivers/common/cnxk/cnxk_telemetry_nix.c | 3 +++ drivers/common/cnxk/roc_irq.c | 5 ++++- drivers/common/cnxk/roc_nix_debug.c | 4 +++- drivers/common/cnxk/roc_nix_tm.c | 6 ++++-- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c b/drivers/common/cnxk/cnxk_telemetry_nix.c index df6458039d..4119e9ee4f 100644 --- a/drivers/common/cnxk/cnxk_telemetry_nix.c +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c @@ -766,4 +766,7 @@ cnxk_nix_tel_handle_info_x(const char *cmd, const char *params, plt_strlcpy(buf, params, PCI_PRI_STR_SIZE + 1); name = strtok(buf, ","); + if (name == NULL) + goto exit; + param = strtok(NULL, "\0"); diff --git a/drivers/common/cnxk/roc_irq.c b/drivers/common/cnxk/roc_irq.c index 7a24297d72..010b121176 100644 --- a/drivers/common/cnxk/roc_irq.c +++ b/drivers/common/cnxk/roc_irq.c @@ -161,5 +161,8 @@ dev_irq_register(struct plt_intr_handle *intr_handle, plt_intr_callback_fn cb, } - plt_intr_efds_index_set(intr_handle, vec, fd); + rc = plt_intr_efds_index_set(intr_handle, vec, fd); + if (rc) + return rc; + nb_efd = (vec > (uint32_t)plt_intr_nb_efd_get(intr_handle)) ? vec : (uint32_t)plt_intr_nb_efd_get(intr_handle); diff --git a/drivers/common/cnxk/roc_nix_debug.c b/drivers/common/cnxk/roc_nix_debug.c index 7dc54f3845..9829c13b69 100644 --- a/drivers/common/cnxk/roc_nix_debug.c +++ b/drivers/common/cnxk/roc_nix_debug.c @@ -53,5 +53,7 @@ nix_bitmap_dump(struct plt_bitmap *bmp) plt_bitmap_scan_init(bmp); - plt_bitmap_scan(bmp, &pos, &slab); + if (!plt_bitmap_scan(bmp, &pos, &slab)) + return; + start_pos = pos; diff --git a/drivers/common/cnxk/roc_nix_tm.c b/drivers/common/cnxk/roc_nix_tm.c index ebb27a3106..e765fe703c 100644 --- a/drivers/common/cnxk/roc_nix_tm.c +++ b/drivers/common/cnxk/roc_nix_tm.c @@ -1017,6 +1017,8 @@ nix_tm_assign_hw_id(struct nix *nix, struct nix_tm_node *parent, } - if (!slab) - plt_bitmap_scan(bmp, &pos, &slab); + if (!slab) { + if (!plt_bitmap_scan(bmp, &pos, &slab)) + return -ENOENT; + } if (child->priority == parent->rr_prio && spare_schq != -1) { -- 2.34.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2022-03-01 10:41:02.803239831 +0000 +++ 0052-common-cnxk-add-missing-checks-of-return-values.patch 2022-03-01 10:41:01.337244105 +0000 @@ -1 +1 @@ -From 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 Mon Sep 17 00:00:00 2001 +From 7eeb8d37ed5884fce3d62c9fd7459b1ceb503f58 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit 14f7e5d4bf2d2c90c715b7d1cf1a973829289499 ] + @@ -13 +14,0 @@ -Cc: stable@dpdk.org @@ -51 +52 @@ -index d5143882f5..1ae045172e 100644 +index 7dc54f3845..9829c13b69 100644 @@ -64 +65 @@ -index a0448bec61..517502b1af 100644 +index ebb27a3106..e765fe703c 100644