提交 e96e0ede 编写于 作者: J jbaron@akamai.com 提交者: David S. Miller

bnx2x: free the mac filter group list before freeing the cmd

The group list must be freed prior to freeing the command otherwise
we have a use-after-free.
Signed-off-by: NJason Baron <jbaron@akamai.com>
Cc: Yuval Mintz <Yuval.Mintz@qlogic.com>
Cc: Ariel Elior <Ariel.Elior@qlogic.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 44675a6d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册