From: Dinghao Liu <dinghao.liu@zju.edu.cn>
To: dinghao.liu@zju.edu.cn, kjlu@umn.edu
Cc: Christian Benvenuti <benve@cisco.com>,
Govindarajulu Varadarajan <_govind@gmx.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH] enic: Remove redundant free in enic_set_ringparam
Date: Wed, 23 Dec 2020 20:38:33 +0800 [thread overview]
Message-ID: <20201223123833.14733-1-dinghao.liu@zju.edu.cn> (raw)
The error handling paths in enic_alloc_vnic_resources()
have called enic_free_vnic_resources() before returning.
So we may not need to call it again on failure at caller
side.
Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
---
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/net/ethernet/cisco/enic/enic_ethtool.c b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
index 1a9803f2073e..85a139d39f27 100644
--- a/drivers/net/ethernet/cisco/enic/enic_ethtool.c
+++ b/drivers/net/ethernet/cisco/enic/enic_ethtool.c
@@ -235,7 +235,6 @@ static int enic_set_ringparam(struct net_device *netdev,
if (err) {
netdev_err(netdev,
"Failed to alloc vNIC resources, aborting\n");
- enic_free_vnic_resources(enic);
goto err_out;
}
enic_init_vnic_resources(enic);
--
2.17.1
next reply other threads:[~2020-12-23 12:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-23 12:38 Dinghao Liu [this message]
2020-12-23 20:37 ` [PATCH] enic: Remove redundant free in enic_set_ringparam Jakub Kicinski
2020-12-24 10:16 ` dinghao.liu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201223123833.14733-1-dinghao.liu@zju.edu.cn \
--to=dinghao.liu@zju.edu.cn \
--cc=_govind@gmx.com \
--cc=benve@cisco.com \
--cc=davem@davemloft.net \
--cc=kjlu@umn.edu \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).