* [PATCH] enic: Remove redundant free in enic_set_ringparam
@ 2020-12-23 12:38 Dinghao Liu
2020-12-23 20:37 ` Jakub Kicinski
0 siblings, 1 reply; 3+ messages in thread
From: Dinghao Liu @ 2020-12-23 12:38 UTC (permalink / raw)
To: dinghao.liu, kjlu
Cc: Christian Benvenuti, Govindarajulu Varadarajan, David S. Miller,
Jakub Kicinski, netdev, linux-kernel
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
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] enic: Remove redundant free in enic_set_ringparam
2020-12-23 12:38 [PATCH] enic: Remove redundant free in enic_set_ringparam Dinghao Liu
@ 2020-12-23 20:37 ` Jakub Kicinski
2020-12-24 10:16 ` dinghao.liu
0 siblings, 1 reply; 3+ messages in thread
From: Jakub Kicinski @ 2020-12-23 20:37 UTC (permalink / raw)
To: Dinghao Liu
Cc: kjlu, Christian Benvenuti, Govindarajulu Varadarajan,
David S. Miller, netdev, linux-kernel
On Wed, 23 Dec 2020 20:38:33 +0800 Dinghao Liu wrote:
> 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>
But it's harmless, right? So the patch is just a cleanup not a fix?
In that case, could you please repost in two weeks? We're currently
in the merge window period, we're only accepting fixes to the
networking trees.
Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Re: [PATCH] enic: Remove redundant free in enic_set_ringparam
2020-12-23 20:37 ` Jakub Kicinski
@ 2020-12-24 10:16 ` dinghao.liu
0 siblings, 0 replies; 3+ messages in thread
From: dinghao.liu @ 2020-12-24 10:16 UTC (permalink / raw)
To: Jakub Kicinski
Cc: kjlu, Christian Benvenuti, Govindarajulu Varadarajan,
David S. Miller, netdev, linux-kernel
> On Wed, 23 Dec 2020 20:38:33 +0800 Dinghao Liu wrote:
> > 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>
>
> But it's harmless, right? So the patch is just a cleanup not a fix?
>
I think it's harmless. Since there is a check every time before freeing,
calling enic_free_vnic_resources() twice has no security issue.
> In that case, could you please repost in two weeks? We're currently
> in the merge window period, we're only accepting fixes to the
> networking trees.
>
> Thanks!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-12-24 10:17 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-23 12:38 [PATCH] enic: Remove redundant free in enic_set_ringparam Dinghao Liu
2020-12-23 20:37 ` Jakub Kicinski
2020-12-24 10:16 ` dinghao.liu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.