be2net: Fix memory leak in be_cmd_get_profile_config()
Subsystems (3)
PATCH 1/1 be2net: Fix memory leak in be_cmd_get_profile_config()
DMA allocated memory is lost in be_cmd_get_profile_config() when we call it with non-NULL port_res parameter.
Signed-off-by Petr Oros <[email protected]>
--- drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/emulex/benet/be_cmds.c +1 -1
@@ -4500,7 +4500,7 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, port_res->max_vfs +=le16_to_cpu (pcie->num_vfs); } } -return status; + goto err; } pcie = be_get_pcie_desc(resp->func_param, desc_count,
Signature · 1 line
2.16.4
Quoted 14 lines · Petr Oros
DMA allocated memory is lost in
be_cmd_get_profile_config()when we call it with non-NULLport_resparameter.Signed-off-by Petr Oros <[email protected]>--- drivers/net/ethernet/emulex/benet/be_cmds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/net/ethernet/emulex/benet/be_cmds.c +0
-0
drivers/net/ethernet/emulex/benet/be_cmds.c int be_cmd_get_profile_config(struct be_adapter *adapter, · line 4506
Quoted 8 lines
drivers/net/ethernet/emulex/benet/be_cmds.c +1
-1@@ -4500,7 +4500,7 @@ int be_cmd_get_profile_config(struct be_adapter *adapter, port_res->max_vfs +=le16_to_cpu (pcie->num_vfs); } } -return status; + goto err; } pcie = be_get_pcie_desc(resp->func_param, desc_count,
Good catch, Petr.
Reviewed-by Ivan Vecera <[email protected]>
From: Petr Oros <[email protected]>
Date: Wed, 5 Sep 2018 14:37:45 +0200
Quoted 4 lines
DMA allocated memory is lost in
be_cmd_get_profile_config()when we call it with non-NULLport_resparameter.Signed-off-by Petr Oros <[email protected]>
Applied, thank you.