From: Haggai Eran Date: Tue, 14 Jan 2014 15:45:13 +0000 (+0200) Subject: mlx5_core: Fix out arg size in access_register command X-Git-Tag: v3.14-rc1~103^2~1^7~11 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=e08a8761d89b7625144c3fbf0ff9643159135c96;p=linux.git mlx5_core: Fix out arg size in access_register command The output size should be the sum of the core access reg output struct plus the size of the specific register data provided by the caller. Signed-off-by: Haggai Eran Signed-off-by: Eli Cohen Signed-off-by: Roland Dreier --- diff --git a/drivers/net/ethernet/mellanox/mlx5/core/port.c b/drivers/net/ethernet/mellanox/mlx5/core/port.c index f6afe7b5a675..8c9ac870ecb1 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/port.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/port.c @@ -57,7 +57,7 @@ int mlx5_core_access_reg(struct mlx5_core_dev *dev, void *data_in, in->arg = cpu_to_be32(arg); in->register_id = cpu_to_be16(reg_num); err = mlx5_cmd_exec(dev, in, sizeof(*in) + size_in, out, - sizeof(out) + size_out); + sizeof(*out) + size_out); if (err) goto ex2;