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 84AA9A04A3 for ; Fri, 5 Jun 2020 20:27:11 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 5F2291D525; Fri, 5 Jun 2020 20:27:11 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by dpdk.org (Postfix) with ESMTP id 49DCB1D560 for ; Fri, 5 Jun 2020 20:27:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1591381629; 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=cQt50m2J1YTpY24sSlgmupNnjPkmr/5DiWce0jM7tws=; b=NP6U8sfXg3yv/i0qQkV4QDmTN4Es7d+UG/l/hftQLdOHRJUjsiLrSSZLkcH0SIGe1HFhvK 1eL1g9kcWv3LIZeuUade8QPZ2Wz34MrGeYAiT8xhCNftwWvgmtKoUpSA7q6jvEl7CT0dDe XDxZibA/gbwKRC62C90wEGRnWQvAhRc= 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-309-JZ4uCeo1On2mL5_eHehFjA-1; Fri, 05 Jun 2020 14:27:07 -0400 X-MC-Unique: JZ4uCeo1On2mL5_eHehFjA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E8707107ACCD; Fri, 5 Jun 2020 18:27:05 +0000 (UTC) Received: from rh.redhat.com (unknown [10.33.36.130]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1279160E1C; Fri, 5 Jun 2020 18:27:04 +0000 (UTC) From: Kevin Traynor To: Michael Baum Cc: Matan Azrad , dpdk stable Date: Fri, 5 Jun 2020 19:24:42 +0100 Message-Id: <20200605182525.22483-45-ktraynor@redhat.com> In-Reply-To: <20200605182525.22483-1-ktraynor@redhat.com> References: <20200605182525.22483-1-ktraynor@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/mlx4: fix drop queue error handling' has been queued to LTS release 18.11.9 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.9 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 06/10/20. 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-queue This queued commit can be viewed at: https://github.com/kevintraynor/dpdk-stable-queue/commit/4b16538be8008edf9d556f159862b1abb42e8610 Thanks. Kevin. --- >From 4b16538be8008edf9d556f159862b1abb42e8610 Mon Sep 17 00:00:00 2001 From: Michael Baum Date: Wed, 6 May 2020 16:27:54 +0000 Subject: [PATCH] net/mlx4: fix drop queue error handling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [ upstream commit 6f155c0b9de5a58b5653d3e81c553564984f3c36 ] The function mlx4_drop_get() creates pointer to a struct mlx4_drop and if needed allocates by rte_malloc. If the allocation is failed the function goes to label “error”, and there does dereference to a null pointer. Skip resources cleaning when the memory allocation is failed. Coverity issue: 146206 Coverity issue: 146146 Fixes: d3a7e09234e4 ("net/mlx4: allocate drop flow resources on demand") Signed-off-by: Michael Baum Acked-by: Matan Azrad --- drivers/net/mlx4/mlx4_flow.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c index 5136d136ff..dfdc790aaf 100644 --- a/drivers/net/mlx4/mlx4_flow.c +++ b/drivers/net/mlx4/mlx4_flow.c @@ -977,10 +977,11 @@ mlx4_drop_get(struct mlx4_priv *priv) return drop; error: - if (drop->qp) - claim_zero(mlx4_glue->destroy_qp(drop->qp)); - if (drop->cq) - claim_zero(mlx4_glue->destroy_cq(drop->cq)); - if (drop) + if (drop) { + if (drop->qp) + claim_zero(mlx4_glue->destroy_qp(drop->qp)); + if (drop->cq) + claim_zero(mlx4_glue->destroy_cq(drop->cq)); rte_free(drop); + } rte_errno = ENOMEM; return NULL; -- 2.21.3 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-06-05 19:20:53.300923714 +0100 +++ 0045-net-mlx4-fix-drop-queue-error-handling.patch 2020-06-05 19:20:50.824040495 +0100 @@ -1 +1 @@ -From 6f155c0b9de5a58b5653d3e81c553564984f3c36 Mon Sep 17 00:00:00 2001 +From 4b16538be8008edf9d556f159862b1abb42e8610 Mon Sep 17 00:00:00 2001 @@ -8,0 +9,2 @@ +[ upstream commit 6f155c0b9de5a58b5653d3e81c553564984f3c36 ] + @@ -20 +21,0 @@ -Cc: stable@dpdk.org @@ -29 +30 @@ -index 793f0b090e..2a86382db7 100644 +index 5136d136ff..dfdc790aaf 100644 @@ -32 +33 @@ -@@ -981,10 +981,11 @@ mlx4_drop_get(struct mlx4_priv *priv) +@@ -977,10 +977,11 @@ mlx4_drop_get(struct mlx4_priv *priv)