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 DD42045D5D for ; Thu, 21 Nov 2024 00:43:10 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D7C0D4328B; Thu, 21 Nov 2024 00:43:10 +0100 (CET) Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mails.dpdk.org (Postfix) with ESMTP id 21E694328B for ; Thu, 21 Nov 2024 00:43:10 +0100 (CET) Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-431695fa98bso1962085e9.3 for ; Wed, 20 Nov 2024 15:43:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732146190; x=1732750990; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=7PUm6OU6k+E0hz+SDAd3ICyTcZ9iNUDa4Vgk993U3hE=; b=UAY5AZAiBO02ZyIIrKolFSmPpe8IhterwrtxDVsLpwST75E/XkJEehtCYLW8HQAOqC kr9fl8G5upGMYTis3PPn1uXPTkUU/7dFTc+i0tHBzLRUZNhkIvA4myjDAli3P9ZYqphO wK4TD1hditzQCdSfeU35Bk2UfJREqRl7JuMIoP/BRnsnQESgl0yiz5DyxiRBkfYVAZ2D AsKLW29/6mxUz8s53EgPgT8w0Co303ZeJLTpUKqHnNEgZRDHeZAu5hZb/iY8Qy8jnEW8 5AQYXWET24WcliZ5rhl2V/lnjf/lCI6vUtyy/8iZZXgMyiV/qAzWUU8i6g9m4vyY/njD vxzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732146190; x=1732750990; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7PUm6OU6k+E0hz+SDAd3ICyTcZ9iNUDa4Vgk993U3hE=; b=mKel8n4BcGgZohI3e+DbhQ14BqaBq+iUWN2C5PW24h7+sQakUDBZW2Hc+4Pf/znPLw y/TP+9REi0KUJmCdW46qcYBhbsu5ykhvT0UzMLW0QY8qo95iPvn7UtHvIn9K/lRTJXQb tgtDBz9iiXcd5FEY7e2l8LvC+DJHPR4Ty22Javd8CiDiBvm5ILev0tAoCtMNbuH5F82m i+SKWD0e04Lj3WayUE7LYrn7+VOpTkJEp1nd63QAdXvqgiryYwh3UFouhofcnFjsCmeM S7T1YQcAD80sReFJrkXAF0ADqosTjmA5e4Zn/cN9ypXQ9wI/dEQegYnqReKNKORqCg0W pKIw== X-Forwarded-Encrypted: i=1; AJvYcCXECfNKyo0/8FAuV9mjtImfXSIQdAalnYC1peyzGb2iZl63W+BWSplHnhMGss+CimR3M3J+xgc=@dpdk.org X-Gm-Message-State: AOJu0YwGDH11eZuIMlYPZ55i6DkNRyPdUYgz//Kbu5+csdewRgbXY8LH 9z1kE/txEW1QBKYCrycKtCBLs+ilelKoBQaYFshxWu+A1k1H8+ZHGs7sL2aK X-Gm-Gg: ASbGncvh4XvlkchjikJFGc0dQqyB1dRoD7raQRkFvr4kEL0U07L1YAzH30eSgCqqM7n mZrpx/EwU9XxOM0OUKSYnxqNktLB07YajwiC4tuNtzxb6rqGZ5KnK2JyHgPR9Q0sckx8ied1tzL afDBPIdTHQKvtEsk2okpMW7dZZ/GeNidV5JBJWA+y9Yx60mCuzmwq/fHEawr/p/O6tdbkuEaelF 7fCoZTT3RYxv1VRl23p43bI2jWVgY4j2I7CYJ7kKr2zj6+nyDrG9jqR X-Google-Smtp-Source: AGHT+IHOPfaxjKoRHW5R6f3Kc3LB3yb/8AX3vRUVqhrjRZ8iTDhz8M/gNXb86bvs4tWqm6ulMyvt0A== X-Received: by 2002:a05:600c:35c4:b0:431:561b:b32a with SMTP id 5b1f17b1804b1-433489d67fdmr36664265e9.19.1732146189674; Wed, 20 Nov 2024 15:43:09 -0800 (PST) Received: from localhost ([2a01:4b00:d036:ae00:21cd:def0:a01d:d2aa]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-433b01e1165sm34829185e9.2.2024.11.20.15.43.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Nov 2024 15:43:08 -0800 (PST) From: luca.boccassi@gmail.com To: Stephen Hemminger Cc: Ferruh Yigit , dpdk stable Subject: patch 'net/dpaa2: remove unnecessary check for null before free' has been queued to stable release 22.11.7 Date: Wed, 20 Nov 2024 23:41:39 +0000 Message-ID: <20241120234215.233355-14-luca.boccassi@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241120234215.233355-1-luca.boccassi@gmail.com> References: <20241112220754.666489-40-luca.boccassi@gmail.com> <20241120234215.233355-1-luca.boccassi@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 22.11.7 Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet. It will be pushed if I get no objections before 11/22/24. 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/bluca/dpdk-stable This queued commit can be viewed at: https://github.com/bluca/dpdk-stable/commit/591f0841c67868b7b97aab9369a695153dc55a69 Thanks. Luca Boccassi --- >From 591f0841c67868b7b97aab9369a695153dc55a69 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 12 Nov 2024 09:38:02 -0800 Subject: [PATCH] net/dpaa2: remove unnecessary check for null before free [ upstream commit e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c ] Calling rte_free() with NULL parameter is allowed. Found by nullfree.cocci Fixes: 5964d36a2904 ("net/dpaa2: release port upon close") Signed-off-by: Stephen Hemminger Acked-by: Ferruh Yigit --- drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/dpaa2/dpaa2_ethdev.c b/drivers/net/dpaa2/dpaa2_ethdev.c index 8e610b6bba..834f904c14 100644 --- a/drivers/net/dpaa2/dpaa2_ethdev.c +++ b/drivers/net/dpaa2/dpaa2_ethdev.c @@ -1390,8 +1390,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) for (i = 0; i < MAX_TCS; i++) rte_free((void *)(size_t)priv->extract.tc_extract_param[i]); - if (priv->extract.qos_extract_param) - rte_free((void *)(size_t)priv->extract.qos_extract_param); + rte_free((void *)(size_t)priv->extract.qos_extract_param); DPAA2_PMD_INFO("%s: netdev deleted", dev->data->name); return 0; -- 2.45.2 --- Diff of the applied patch vs upstream commit (please double-check if non-empty: --- --- - 2024-11-20 23:41:23.196867601 +0000 +++ 0014-net-dpaa2-remove-unnecessary-check-for-null-before-f.patch 2024-11-20 23:41:22.712195467 +0000 @@ -1 +1 @@ -From e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c Mon Sep 17 00:00:00 2001 +From 591f0841c67868b7b97aab9369a695153dc55a69 Mon Sep 17 00:00:00 2001 @@ -5,0 +6,2 @@ +[ upstream commit e6bf3256b95c77ee4d0b2874e1896d01c41c2d7c ] + @@ -10 +11,0 @@ -Cc: stable@dpdk.org @@ -15,4 +16,2 @@ - drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- - drivers/net/dpaa2/dpaa2_flow.c | 27 +++++++++------------------ - drivers/net/dpaa2/dpaa2_mux.c | 6 ++---- - 3 files changed, 12 insertions(+), 24 deletions(-) + drivers/net/dpaa2/dpaa2_ethdev.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) @@ -21 +20 @@ -index 8cbe481fb5..a9bce854c3 100644 +index 8e610b6bba..834f904c14 100644 @@ -24 +23 @@ -@@ -1401,8 +1401,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) +@@ -1390,8 +1390,7 @@ dpaa2_dev_close(struct rte_eth_dev *dev) @@ -26 +25 @@ - rte_free(priv->extract.tc_extract_param[i]); + rte_free((void *)(size_t)priv->extract.tc_extract_param[i]); @@ -29,2 +28,2 @@ -- rte_free(priv->extract.qos_extract_param); -+ rte_free(priv->extract.qos_extract_param); +- rte_free((void *)(size_t)priv->extract.qos_extract_param); ++ rte_free((void *)(size_t)priv->extract.qos_extract_param); @@ -34,69 +32,0 @@ -diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c -index de850ae0cf..c94eb51ba5 100644 ---- a/drivers/net/dpaa2/dpaa2_flow.c -+++ b/drivers/net/dpaa2/dpaa2_flow.c -@@ -4784,8 +4784,7 @@ end_flow_set: - } - } - -- if (dpaa2_pattern) -- rte_free(dpaa2_pattern); -+ rte_free(dpaa2_pattern); - - return ret; - } -@@ -5057,14 +5056,10 @@ mem_failure: - - creation_error: - if (flow) { -- if (flow->qos_key_addr) -- rte_free(flow->qos_key_addr); -- if (flow->qos_mask_addr) -- rte_free(flow->qos_mask_addr); -- if (flow->fs_key_addr) -- rte_free(flow->fs_key_addr); -- if (flow->fs_mask_addr) -- rte_free(flow->fs_mask_addr); -+ rte_free(flow->qos_key_addr); -+ rte_free(flow->qos_mask_addr); -+ rte_free(flow->fs_key_addr); -+ rte_free(flow->fs_mask_addr); - rte_free(flow); - } - priv->curr = NULL; -@@ -5128,14 +5123,10 @@ dpaa2_flow_destroy(struct rte_eth_dev *dev, struct rte_flow *_flow, - } - - LIST_REMOVE(flow, next); -- if (flow->qos_key_addr) -- rte_free(flow->qos_key_addr); -- if (flow->qos_mask_addr) -- rte_free(flow->qos_mask_addr); -- if (flow->fs_key_addr) -- rte_free(flow->fs_key_addr); -- if (flow->fs_mask_addr) -- rte_free(flow->fs_mask_addr); -+ rte_free(flow->qos_key_addr); -+ rte_free(flow->qos_mask_addr); -+ rte_free(flow->fs_key_addr); -+ rte_free(flow->fs_mask_addr); - /* Now free the flow */ - rte_free(flow); - -diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c -index e9d48a81a8..2f124313fa 100644 ---- a/drivers/net/dpaa2/dpaa2_mux.c -+++ b/drivers/net/dpaa2/dpaa2_mux.c -@@ -329,10 +329,8 @@ rte_pmd_dpaa2_mux_flow_create(uint32_t dpdmux_id, - } - - creation_error: -- if (key_cfg_va) -- rte_free(key_cfg_va); -- if (key_va) -- rte_free(key_va); -+ rte_free(key_cfg_va); -+ rte_free(key_va); - - return ret; - }