Message ID | fc535be629990acef5e2a3dfecd64a5f9661fd25.1685349266.git.christophe.jaillet@wanadoo.fr |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp1365119vqr; Mon, 29 May 2023 01:42:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ67Fbw3TsVxpvb6lM1delgO/zAC4ENT9o067iifZEFRHWI4SBb2B0Q5nGzgf7gS+FBqxbI0 X-Received: by 2002:a05:6a00:124a:b0:643:96bc:b292 with SMTP id u10-20020a056a00124a00b0064396bcb292mr15317415pfi.5.1685349730442; Mon, 29 May 2023 01:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685349730; cv=none; d=google.com; s=arc-20160816; b=NBEdFfq7HuWfcMTDHWSlngBU4GlJ/AWNI25py4Yj10nwvOmZkmxc9gLJJAA5WfR2e1 uAmHWbeqnzDYtQTbdvb2s43lQpZCl9QcAAamkd++0jv/Pq2PFWc7nTWSP/WsbnvE7GBQ ya1XKFa4D2kL7Zd2gx48oppHjPLb6MapBn1rOmhw+2MMp98xj1xizKPmkR9XaRACDPJj PdYBXCrddHqSwZygzRT76uTEx9aAj07kQ4uC14q5Rbn5W909POC+qbrunsqrb1RuSdzJ UnsalqsgucmtPOLZD9SFymm1dFB05mNA5Iexet2VxepqLcs0uC0YhTTB4XsGnONJq+lV GQgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=AugTDYeUrgYVPU+UhwnDyYDQ1NS0yzyFbGk6wtykwr8=; b=hDlbw690KE6qmEMugRU6UYZ67vc6tGomkqCA88WLn/mlLHEj8iBuKONqLKn8nYmCRe rnOYbBG7cIP2sQTjFOQofazaGJVGqfl0HLXoMZW2BBrdtXTvRKzvl3NoNQ/stYBmQQmy YnNoQFnUNB8/+9Wi1eQfrU54BxcUB+IMwVOEfGOUKWe3ZPTRPkHopidxEBn8WCdi8Loz pk+37gN3B8CqPFloxbVIUgVpocqjzoB+zqb05E7nvVmT3736UMLA1nLtptvdhsvO2Db+ Btx9dMBcmmJ7CKErtp1sIGT8wW46Aw8ArD0JS0UW+A+kZZiYEAdOtnnhEKxhpObHH4Ez lpwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Fy9a4XVT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d185-20020a621dc2000000b0064d28479818si9017231pfd.96.2023.05.29.01.41.55; Mon, 29 May 2023 01:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Fy9a4XVT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231486AbjE2IfK (ORCPT <rfc822;callmefire3@gmail.com> + 99 others); Mon, 29 May 2023 04:35:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231455AbjE2IfH (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 29 May 2023 04:35:07 -0400 Received: from smtp.smtpout.orange.fr (smtp-16.smtpout.orange.fr [80.12.242.16]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E73E3A7 for <linux-kernel@vger.kernel.org>; Mon, 29 May 2023 01:35:04 -0700 (PDT) Received: from pop-os.home ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 3YLEqMBiidqvJ3YLEqNSes; Mon, 29 May 2023 10:35:02 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685349302; bh=AugTDYeUrgYVPU+UhwnDyYDQ1NS0yzyFbGk6wtykwr8=; h=From:To:Cc:Subject:Date; b=Fy9a4XVTNFNs6Oz3bZxhAdqcmQ3HJaQc8jhkHb31k1p2J0kMFRF9y51tPBkti4Me/ UwJ4GLS63q9pb/md+lydpgA/Cekhiu0HHY9lv2ig8OcsW1e9WHbpq9MrMhYRNf+5wE BUcE0/+6wrp3BvFsm07/p+EprzX68DAFWLw8ayglqEXTFV3gIkCewyVJqi0sw9ZFMi 16qpwnYrtprS7MRvMYweOwi+8q6yqBLBFv/Ud0NQMGYYAJwIpTspccE2o2WHda/V4O krXzPyZQ6kW0cu/gSYxMzrc1lM6ndVvi9/J33kqxDbue6MJIGwBHrAr4Vf5h/VLRKt v7TD8aFYZABdw== X-ME-Helo: pop-os.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Mon, 29 May 2023 10:35:02 +0200 X-ME-IP: 86.243.2.178 From: Christophe JAILLET <christophe.jaillet@wanadoo.fr> To: Saeed Mahameed <saeedm@nvidia.com>, Leon Romanovsky <leon@kernel.org>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com> Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr>, netdev@vger.kernel.org, linux-rdma@vger.kernel.org Subject: [PATCH net-next] net/mlx5e: Remove a useless function call Date: Mon, 29 May 2023 10:34:59 +0200 Message-Id: <fc535be629990acef5e2a3dfecd64a5f9661fd25.1685349266.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1767217278950406295?= X-GMAIL-MSGID: =?utf-8?q?1767217278950406295?= |
Series |
[net-next] net/mlx5e: Remove a useless function call
|
|
Commit Message
Christophe JAILLET
May 29, 2023, 8:34 a.m. UTC
'handle' is known to be NULL here. There is no need to kfree() it.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Comments
On Mon, May 29, 2023 at 10:34:59AM +0200, Christophe JAILLET wrote: > 'handle' is known to be NULL here. There is no need to kfree() it. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: Simon Horman <simon.horman@corigine.com>
On 29/05/2023 11:34, Christophe JAILLET wrote: > 'handle' is known to be NULL here. There is no need to kfree() it. > > Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> > --- > drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c > index 0290e0dea539..4e923a2874ae 100644 > --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c > +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c > @@ -112,10 +112,8 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *po > int err; > > handle = kzalloc(sizeof(*handle), GFP_KERNEL); > - if (!handle) { > - kfree(handle); > + if (!handle) > return ERR_PTR(-ENOMEM); > - } > > post_attr->chain = 0; > post_attr->prio = 0; Reviewed-by: Tariq Toukan <tariqt@nvidia.com> Thanks for your patch.
On 29 May 10:34, Christophe JAILLET wrote: >'handle' is known to be NULL here. There is no need to kfree() it. > >Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Applied to net-next-mlx5. Thanks
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c index 0290e0dea539..4e923a2874ae 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en/tc/post_act.c @@ -112,10 +112,8 @@ mlx5e_tc_post_act_add(struct mlx5e_post_act *post_act, struct mlx5_flow_attr *po int err; handle = kzalloc(sizeof(*handle), GFP_KERNEL); - if (!handle) { - kfree(handle); + if (!handle) return ERR_PTR(-ENOMEM); - } post_attr->chain = 0; post_attr->prio = 0;