* [PATCH net-next] bnx2x: free the mac filter group list before freeing the cmd
@ 2016-09-26 15:00 Jason Baron
2016-09-27 13:55 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Jason Baron @ 2016-09-26 15:00 UTC (permalink / raw)
To: davem; +Cc: Yuval.Mintz, Ariel.Elior, netdev
The group list must be freed prior to freeing the command otherwise
we have a use-after-free.
Signed-off-by: Jason Baron <jbaron@akamai.com>
Cc: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: Ariel Elior <Ariel.Elior@qlogic.com>
---
drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
index 4947a9c..cea6bdc 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sp.c
@@ -2714,8 +2714,8 @@ static int bnx2x_mcast_enqueue_cmd(struct bnx2x *bp,
elem_group = (struct bnx2x_mcast_elem_group *)
__get_free_page(GFP_ATOMIC | __GFP_ZERO);
if (!elem_group) {
- kfree(new_cmd);
bnx2x_free_groups(&new_cmd->group_head);
+ kfree(new_cmd);
return -ENOMEM;
}
total_elems -= MCAST_MAC_ELEMS_PER_PG;
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-27 13:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-26 15:00 [PATCH net-next] bnx2x: free the mac filter group list before freeing the cmd Jason Baron
2016-09-27 13:55 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox