]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: FPGA, return -EINVAL if size is zero
authorKamal Heib <kamalh@mellanox.com>
Sun, 29 Oct 2017 02:03:37 +0000 (04:03 +0200)
committerSaeed Mahameed <saeedm@mellanox.com>
Tue, 19 Dec 2017 21:23:57 +0000 (23:23 +0200)
commit50f6b9b266377c562e89495125af18628fa348d1
tree31b9eeff1c91126a07d4ec2fa4be80675e8ca71a
parente0bf99135eb36f0dcb27a4a5da1e008ef847c479
net/mlx5: FPGA, return -EINVAL if size is zero

Currently, if a size of zero is passed to
mlx5_fpga_mem_{read|write}_i2c()
the "err" return value will not be initialized, which triggers gcc
warnings:

[..]/mlx5/core/fpga/sdk.c:87 mlx5_fpga_mem_read_i2c() error:
uninitialized symbol 'err'.
[..]/mlx5/core/fpga/sdk.c:115 mlx5_fpga_mem_write_i2c() error:
uninitialized symbol 'err'.

fix that.

Fixes: f6b5465e287c ('net/mlx5: FPGA, Add SBU infrastructure')
Signed-off-by: Kamal Heib <kamalh@mellanox.com>
Reviewed-by: Yevgeny Kliteynik <kliteyn@mellanox.com>
Signed-off-by: Saeed Mahameed <saeedm@mellanox.com>
drivers/net/ethernet/mellanox/mlx5/core/fpga/sdk.c