net/mlx4: Remove BUG_ON from ICM allocation routine
authorLeon Romanovsky <leonro@mellanox.com>
Thu, 29 Dec 2016 16:37:11 +0000 (18:37 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 16 Mar 2017 02:18:34 +0000 (02:18 +0000)
commitc1905ee1495b4f2b1dafe7f302e65ff49f0b47ef
tree7c5754f9a6851078e0a2fa59c0e2c15c4aa94d53
parent5de0b992380855663fc37370af50deea03212458
net/mlx4: Remove BUG_ON from ICM allocation routine

commit c1d5f8ff80ea84768f5fae1ca9d1abfbb5e6bbaa upstream.

This patch removes BUG_ON() macro from mlx4_alloc_icm_coherent()
by checking DMA address alignment in advance and performing proper
folding in case of error.

Fixes: 5b0bf5e25efe ("mlx4_core: Support ICM tables in coherent memory")
Reported-by: Ozgur Karatas <okaratas@member.fsf.org>
Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
Signed-off-by: Tariq Toukan <tariqt@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/net/ethernet/mellanox/mlx4/icm.c