Skip to content

Commit

Permalink
mlxsw: Use correct skb length when dumping payload
Browse files Browse the repository at this point in the history
Do not use the length of the transmitted skb (which was freed), but
that of the response skb.

This issue was discovered using the Kernel Address sanitizer (KASan).

Signed-off-by: Ido Schimmel <[email protected]>
Signed-off-by: Jiri Pirko <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
idosch authored and davem330 committed Aug 10, 2015
1 parent d003462 commit 3bfcd34
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/mellanox/mlxsw/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,7 +1073,7 @@ static int mlxsw_core_reg_access_emad(struct mlxsw_core *mlxsw_core,
mlxsw_core->emad.tid - 1);
mlxsw_core_buf_dump_dbg(mlxsw_core,
mlxsw_core->emad.resp_skb->data,
skb->len);
mlxsw_core->emad.resp_skb->len);

dev_kfree_skb(mlxsw_core->emad.resp_skb);
}
Expand Down

0 comments on commit 3bfcd34

Please sign in to comment.