OSDN Git Service

mlxsw: core: Zero payload buffers for couple of registers
authorElad Raz <eladr@mellanox.com>
Fri, 28 Oct 2016 19:35:46 +0000 (21:35 +0200)
committerDavid S. Miller <davem@davemloft.net>
Sun, 30 Oct 2016 20:50:17 +0000 (16:50 -0400)
commit5b0907407e7f28249ddb44ca0e629dda3d300169
tree81e8ea719b1fcca2f24cd786164f3eaf02596e00
parent27058af401e49d88a905df000dd26f443fcfa8ce
mlxsw: core: Zero payload buffers for couple of registers

We recently discovered a bug in the firmware in which a field's length in
one of the registers was incorrectly set. This caused the firmware to
access garbage data that wasn't initialized by the driver and therefore
emit error messages.

While the bug is already fixed and the driver usually zeros the buffers
passed to the firmware, there are a handful of cases where this isn't
done. Zero the buffer in these cases and prevent similar bugs from
recurring, as they tend to be hard to debug.

Fixes: 52581961d83d ("mlxsw: core: Implement fan control using hwmon")
Signed-off-by: Elad Raz <eladr@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/core_hwmon.c
drivers/net/ethernet/mellanox/mlxsw/spectrum.c
drivers/net/ethernet/mellanox/mlxsw/switchx2.c