From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id E1C48A04B5 for ; Tue, 3 Dec 2019 19:28:30 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D1D481BF74; Tue, 3 Dec 2019 19:28:30 +0100 (CET) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id 66335235 for ; Tue, 3 Dec 2019 19:28:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575397708; 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=IpyauIVK5pJH0Rfuj7sCaD7bQJqJX2Q+d56Ey/NzRA4=; b=FuLk5ljCwPgy0ZBCvkWRQd3hYTUmZQkw8e/KwhfdBmkSh8h+CfEp4imypQTzZG2Tiju2yJ iNecWLV5wAxCXOAQNbgQUA7G/JD8vihMGrlAlbqyLz4nMnqq77p/r2tBG+Lz+dLv2Ulqoo AENqEsOUz8KcZLy3Kxq9DlHOpUV5bWE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-192-JpEv7nm0POCLZ3bqmXPNXg-1; Tue, 03 Dec 2019 13:28:25 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A698B107ACC5; Tue, 3 Dec 2019 18:28:24 +0000 (UTC) Received: from rh.redhat.com (ovpn-117-10.ams2.redhat.com [10.36.117.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5E9165C240; Tue, 3 Dec 2019 18:28:23 +0000 (UTC) From: Kevin Traynor To: Kalesh AP Cc: Ajit Khaparde , Santoshkumar Karanappa Rastapur , dpdk stable Date: Tue, 3 Dec 2019 18:26:38 +0000 Message-Id: <20191203182714.17297-29-ktraynor@redhat.com> In-Reply-To: <20191203182714.17297-1-ktraynor@redhat.com> References: <20191203182714.17297-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-MC-Unique: JpEv7nm0POCLZ3bqmXPNXg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-stable] patch 'net/bnxt: fix accessing variable before null check' has been queued to LTS release 18.11.6 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 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 Sender: "stable" Hi, FYI, your patch has been queued to LTS release 18.11.6 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 12/10/19. 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 rebasi= ng (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-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/1b219a2784c22e4002= 3d7f9a5b749bf74c46a8d1 Thanks. Kevin. --- >From 1b219a2784c22e40023d7f9a5b749bf74c46a8d1 Mon Sep 17 00:00:00 2001 From: Kalesh AP Date: Wed, 2 Oct 2019 10:17:41 -0700 Subject: [PATCH] net/bnxt: fix accessing variable before null check [ upstream commit f0f7b157c179bcccc199adb15eae8bea49649933 ] Check input argument "rxq" in bnxt_rx_queue_release_mbufs(), to be sure variable is not NULL before accessing it. Fixes: 9b63c6fd70e3 ("net/bnxt: support Rx/Tx queue start/stop") Signed-off-by: Kalesh AP Signed-off-by: Ajit Khaparde Reviewed-by: Santoshkumar Karanappa Rastapur --- drivers/net/bnxt/bnxt_rxq.c | 53 +++++++++++++++++++------------------ 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/drivers/net/bnxt/bnxt_rxq.c b/drivers/net/bnxt/bnxt_rxq.c index 1fbc66271..df80ce22f 100644 --- a/drivers/net/bnxt/bnxt_rxq.c +++ b/drivers/net/bnxt/bnxt_rxq.c @@ -208,37 +208,38 @@ void bnxt_rx_queue_release_mbufs(struct bnxt_rx_queue= *rxq) =09uint16_t i; =20 +=09if (!rxq) +=09=09return; + =09rte_spinlock_lock(&rxq->lock); =20 -=09if (rxq) { -=09=09sw_ring =3D rxq->rx_ring->rx_buf_ring; -=09=09if (sw_ring) { -=09=09=09for (i =3D 0; -=09=09=09 i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { -=09=09=09=09if (sw_ring[i].mbuf) { -=09=09=09=09=09rte_pktmbuf_free_seg(sw_ring[i].mbuf); -=09=09=09=09=09sw_ring[i].mbuf =3D NULL; -=09=09=09=09} +=09sw_ring =3D rxq->rx_ring->rx_buf_ring; +=09if (sw_ring) { +=09=09for (i =3D 0; +=09=09 i < rxq->rx_ring->rx_ring_struct->ring_size; i++) { +=09=09=09if (sw_ring[i].mbuf) { +=09=09=09=09rte_pktmbuf_free_seg(sw_ring[i].mbuf); +=09=09=09=09sw_ring[i].mbuf =3D NULL; =09=09=09} =09=09} -=09=09/* Free up mbufs in Agg ring */ -=09=09sw_ring =3D rxq->rx_ring->ag_buf_ring; -=09=09if (sw_ring) { -=09=09=09for (i =3D 0; -=09=09=09 i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { -=09=09=09=09if (sw_ring[i].mbuf) { -=09=09=09=09=09rte_pktmbuf_free_seg(sw_ring[i].mbuf); -=09=09=09=09=09sw_ring[i].mbuf =3D NULL; -=09=09=09=09} +=09} +=09/* Free up mbufs in Agg ring */ +=09sw_ring =3D rxq->rx_ring->ag_buf_ring; +=09if (sw_ring) { +=09=09for (i =3D 0; +=09=09 i < rxq->rx_ring->ag_ring_struct->ring_size; i++) { +=09=09=09if (sw_ring[i].mbuf) { +=09=09=09=09rte_pktmbuf_free_seg(sw_ring[i].mbuf); +=09=09=09=09sw_ring[i].mbuf =3D NULL; =09=09=09} =09=09} +=09} =20 -=09=09/* Free up mbufs in TPA */ -=09=09tpa_info =3D rxq->rx_ring->tpa_info; -=09=09if (tpa_info) { -=09=09=09for (i =3D 0; i < BNXT_TPA_MAX; i++) { -=09=09=09=09if (tpa_info[i].mbuf) { -=09=09=09=09=09rte_pktmbuf_free_seg(tpa_info[i].mbuf); -=09=09=09=09=09tpa_info[i].mbuf =3D NULL; -=09=09=09=09} +=09/* Free up mbufs in TPA */ +=09tpa_info =3D rxq->rx_ring->tpa_info; +=09if (tpa_info) { +=09=09for (i =3D 0; i < BNXT_TPA_MAX; i++) { +=09=09=09if (tpa_info[i].mbuf) { +=09=09=09=09rte_pktmbuf_free_seg(tpa_info[i].mbuf); +=09=09=09=09tpa_info[i].mbuf =3D NULL; =09=09=09} =09=09} --=20 2.21.0 --- Diff of the applied patch vs upstream commit (please double-check if non-= empty: --- --- -=092019-12-03 17:29:53.517143233 +0000 +++ 0029-net-bnxt-fix-accessing-variable-before-null-check.patch=092019-12-= 03 17:29:51.748749995 +0000 @@ -1 +1 @@ -From f0f7b157c179bcccc199adb15eae8bea49649933 Mon Sep 17 00:00:00 2001 +From 1b219a2784c22e40023d7f9a5b749bf74c46a8d1 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit f0f7b157c179bcccc199adb15eae8bea49649933 ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -20 +21 @@ -index 4b506f865..dac8ccb16 100644 +index 1fbc66271..df80ce22f 100644