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 3322FA051C for ; Tue, 11 Feb 2020 12:25:09 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 2617B1BFAA; Tue, 11 Feb 2020 12:25:09 +0100 (CET) Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by dpdk.org (Postfix) with ESMTP id 2ECA21BFA2 for ; Tue, 11 Feb 2020 12:25:08 +0100 (CET) Received: by mail-wr1-f65.google.com with SMTP id u6so11913087wrt.0 for ; Tue, 11 Feb 2020 03:25:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fPAxtq+4wBk+h0MoUHCtqbq+bN4athxStSWP7eVaBQI=; b=dXO3PSYJrds9nQSmMIKD2hz6OlbpZpprBmUvScr0lJBdgywCjnCfatrGH//7+6sZjh 7Zzm0RFprOKNR7OMrdIr+2/FHv+bHNVRZLP/uL3ns7AJvYPZ7iC2k0Qh+c9F0JGSpm+m qgyKl+hWkMbN/2HKRQtFObTWjfuAMWhOgFE0iyw7IDDdaNDdC4w7dIlAWNrpbbyg7bH4 lkG2QDtBjpeMVzonQCmjhLG6jXSY4nuFycAfRfa8nj7BArMvUTDbd+xQrt4+Mzr7Fwxp zrMLsaEdcOmY8iwaq1eaHPOWh8iqb8hEEPWYd+kv/D4BMnKltuNCe6ynUD6n9TV53xFP SB2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=fPAxtq+4wBk+h0MoUHCtqbq+bN4athxStSWP7eVaBQI=; b=CZTL9qa/f939nO2iXXXC7cUg3xIWKKz3GZVZ2uk80HzOhsa4XpHZ0f1/OJyoukWQap lhCQlnUOP/3n3m9TIUwFOEC58ZyzmtfHoehjDz83NmawOEaUYWEResfSbxwvddMOm1V+ RC2nBOLlaK44NECZ+nCPZLkNE4HuVkka/htdhFO1Gu7KsVSgfk1aj2U37Vb9I3eM9EBq DNLfQKaQtHDKf+evLQQU7Nz7issHLosikmlNy4kzNop6YWBT0Z5Mb3ThQAij1dDcmhWJ Y4ocqQaNhTBI/+zXlIDOxm/H37NNtikHrujRw60JtkOdQisVURfvtW0Ug4IUsJ4La+BC 4PIA== X-Gm-Message-State: APjAAAVsdPqv76kyHsWyilCk3VfNcK9tPUe9CtGRqgCggOCQ0HFBtErO ikNbsq7m8ZK5AwWD4gZQeTogzxZMedw= X-Google-Smtp-Source: APXvYqylrHz0PlxHYabm1CU9NMpeWhAqhjyBMH61fF/YkCzU/hp07AS/NeRkJt1wAj2xLwkJFPAWzg== X-Received: by 2002:adf:e446:: with SMTP id t6mr8066243wrm.222.1581420307910; Tue, 11 Feb 2020 03:25:07 -0800 (PST) Received: from localhost ([88.98.246.218]) by smtp.gmail.com with ESMTPSA id p11sm5014494wrn.40.2020.02.11.03.25.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Feb 2020 03:25:07 -0800 (PST) From: luca.boccassi@gmail.com To: Qi Zhang Cc: Pandi Kumar Maharajan , Paul M Stillwell Jr , Qiming Yang , dpdk stable Date: Tue, 11 Feb 2020 11:19:50 +0000 Message-Id: <20200211112216.3929-44-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200211112216.3929-1-luca.boccassi@gmail.com> References: <20200211112216.3929-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-stable] patch 'net/iavf/base: fix command buffer memory leak' has been queued to stable release 19.11.1 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 stable release 19.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 02/13/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. Thanks. Luca Boccassi --- >From 7a5755e521cd4ccebd624ffd8cff45462d7331d0 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 3 Dec 2019 15:03:12 +0800 Subject: [PATCH] net/iavf/base: fix command buffer memory leak [ upstream commit 87aca6d8d8a452ce0d3534dd80bab28ff8e66b58 ] Allocated resources were not freed in the event of failure in iavf_init_asq function. This patch gracefully handles all failures. Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD") Signed-off-by: Pandi Kumar Maharajan Signed-off-by: Paul M Stillwell Jr Signed-off-by: Qi Zhang Acked-by: Qiming Yang --- drivers/net/iavf/base/iavf_adminq.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/base/iavf_adminq.c b/drivers/net/iavf/base/iavf_adminq.c index 1ba8b52219..a8b989aea9 100644 --- a/drivers/net/iavf/base/iavf_adminq.c +++ b/drivers/net/iavf/base/iavf_adminq.c @@ -84,6 +84,7 @@ enum iavf_status_code iavf_alloc_adminq_arq_ring(struct iavf_hw *hw) **/ void iavf_free_adminq_asq(struct iavf_hw *hw) { + iavf_free_virt_mem(hw, &hw->aq.asq.cmd_buf); iavf_free_dma_mem(hw, &hw->aq.asq.desc_buf); } @@ -367,7 +368,7 @@ enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) /* initialize base registers */ ret_code = iavf_config_asq_regs(hw); if (ret_code != IAVF_SUCCESS) - goto init_adminq_free_rings; + goto init_config_regs; /* success! */ hw->aq.asq.count = hw->aq.num_asq_entries; @@ -375,6 +376,10 @@ enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) init_adminq_free_rings: iavf_free_adminq_asq(hw); + return ret_code; + +init_config_regs: + iavf_free_asq_bufs(hw); init_adminq_exit: return ret_code; -- 2.20.1 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2020-02-11 11:17:40.642702341 +0000 +++ 0044-net-iavf-base-fix-command-buffer-memory-leak.patch 2020-02-11 11:17:38.392001197 +0000 @@ -1,13 +1,14 @@ -From 87aca6d8d8a452ce0d3534dd80bab28ff8e66b58 Mon Sep 17 00:00:00 2001 +From 7a5755e521cd4ccebd624ffd8cff45462d7331d0 Mon Sep 17 00:00:00 2001 From: Qi Zhang Date: Tue, 3 Dec 2019 15:03:12 +0800 Subject: [PATCH] net/iavf/base: fix command buffer memory leak +[ upstream commit 87aca6d8d8a452ce0d3534dd80bab28ff8e66b58 ] + Allocated resources were not freed in the event of failure in iavf_init_asq function. This patch gracefully handles all failures. Fixes: e5b2a9e957e7 ("net/avf/base: add base code for avf PMD") -Cc: stable@dpdk.org Signed-off-by: Pandi Kumar Maharajan Signed-off-by: Paul M Stillwell Jr @@ -18,10 +19,10 @@ 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/iavf/base/iavf_adminq.c b/drivers/net/iavf/base/iavf_adminq.c -index ef352ac4c4..298e77277e 100644 +index 1ba8b52219..a8b989aea9 100644 --- a/drivers/net/iavf/base/iavf_adminq.c +++ b/drivers/net/iavf/base/iavf_adminq.c -@@ -82,6 +82,7 @@ enum iavf_status iavf_alloc_adminq_arq_ring(struct iavf_hw *hw) +@@ -84,6 +84,7 @@ enum iavf_status_code iavf_alloc_adminq_arq_ring(struct iavf_hw *hw) **/ void iavf_free_adminq_asq(struct iavf_hw *hw) { @@ -29,7 +30,7 @@ iavf_free_dma_mem(hw, &hw->aq.asq.desc_buf); } -@@ -353,7 +354,7 @@ enum iavf_status iavf_init_asq(struct iavf_hw *hw) +@@ -367,7 +368,7 @@ enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) /* initialize base registers */ ret_code = iavf_config_asq_regs(hw); if (ret_code != IAVF_SUCCESS) @@ -38,7 +39,7 @@ /* success! */ hw->aq.asq.count = hw->aq.num_asq_entries; -@@ -361,6 +362,10 @@ enum iavf_status iavf_init_asq(struct iavf_hw *hw) +@@ -375,6 +376,10 @@ enum iavf_status_code iavf_init_asq(struct iavf_hw *hw) init_adminq_free_rings: iavf_free_adminq_asq(hw);