diff options
author | Jack Morgenstein <jackm@dev.mellanox.co.il> | 2013-03-07 03:46:54 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-03-07 15:52:03 -0500 |
commit | e7dbeba85600aa2c8daf99f8f53d9ad27e88b810 (patch) | |
tree | f1e7a199ef86154b0ae262c13c1b661cf86f97e8 /drivers/net/ethernet/mellanox/mlx4/pd.c | |
parent | 0081c8f3814a8344ca975c085d987ec6c90499ae (diff) | |
download | talos-op-linux-e7dbeba85600aa2c8daf99f8f53d9ad27e88b810.tar.gz talos-op-linux-e7dbeba85600aa2c8daf99f8f53d9ad27e88b810.zip |
net/mlx4_core: Fix endianness bug in set_param_l
The set_param_l function assumes casting a u64 pointer to a u32 pointer
allows to access the lower 32bits, but it results in writing the upper
32 bits on big endian systems.
The fixed function reads the upper 32 bits of the 64 argument, and or's
them with the 32 bits of the 32-bit value passed to the function.
Since this is now a "read-modify-write" operation, we got many
"unintialized variable" warnings which needed to be fixed as well.
Reported-by: Alexander Schmidt <alexschm@de.ibm.com>.
Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Or Gerlitz <ogerlitz@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/mellanox/mlx4/pd.c')
-rw-r--r-- | drivers/net/ethernet/mellanox/mlx4/pd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/mellanox/mlx4/pd.c b/drivers/net/ethernet/mellanox/mlx4/pd.c index 1ac88637ad9d..00f223acada7 100644 --- a/drivers/net/ethernet/mellanox/mlx4/pd.c +++ b/drivers/net/ethernet/mellanox/mlx4/pd.c @@ -101,7 +101,7 @@ void __mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn) void mlx4_xrcd_free(struct mlx4_dev *dev, u32 xrcdn) { - u64 in_param; + u64 in_param = 0; int err; if (mlx4_is_mfunc(dev)) { |