Commit e275e19c authored by Shradha Gupta's avatar Shradha Gupta Committed by Jakub Kicinski

net: mana: Use mana_cleanup_port_context() for rxq cleanup

To cleanup rxqs in port context structures, instead of duplicating the
code, use existing function mana_cleanup_port_context() which does
the exact cleanup that's needed.
Signed-off-by: default avatarShradha Gupta <shradhagupta@linux.microsoft.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarWei Liu <wei.liu@kernel.org>
Reviewed-by: default avatarHeng Qi <hengqi@linux.alibaba.com>
Link: https://lore.kernel.org/r/1718349548-28697-1-git-send-email-shradhagupta@linux.microsoft.comSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent dd89a81d
...@@ -2529,8 +2529,7 @@ static int mana_init_port(struct net_device *ndev) ...@@ -2529,8 +2529,7 @@ static int mana_init_port(struct net_device *ndev)
return 0; return 0;
reset_apc: reset_apc:
kfree(apc->rxqs); mana_cleanup_port_context(apc);
apc->rxqs = NULL;
return err; return err;
} }
...@@ -2787,8 +2786,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx, ...@@ -2787,8 +2786,7 @@ static int mana_probe_port(struct mana_context *ac, int port_idx,
free_indir: free_indir:
mana_cleanup_indir_table(apc); mana_cleanup_indir_table(apc);
reset_apc: reset_apc:
kfree(apc->rxqs); mana_cleanup_port_context(apc);
apc->rxqs = NULL;
free_net: free_net:
*ndev_storage = NULL; *ndev_storage = NULL;
netdev_err(ndev, "Failed to probe vPort %d: %d\n", port_idx, err); netdev_err(ndev, "Failed to probe vPort %d: %d\n", port_idx, err);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment