diff mbox

mlx4: Fix chunk sg list overflow in mlx4_alloc_icm()

Message ID 20100430132131.0d829b3c@frecb007965 (mailing list archive)
State Accepted, archived
Headers show

Commit Message

sebastien dugue April 30, 2010, 11:21 a.m. UTC
None
diff mbox

Patch

diff --git a/drivers/net/mlx4/icm.c b/drivers/net/mlx4/icm.c
index 57288ca..ef62f17 100644
--- a/drivers/net/mlx4/icm.c
+++ b/drivers/net/mlx4/icm.c
@@ -175,9 +175,10 @@  struct mlx4_icm *mlx4_alloc_icm(struct mlx4_dev *dev, int npages,
 
 				if (chunk->nsg <= 0)
 					goto fail;
+			}
 
+			if (chunk->npages == MLX4_ICM_CHUNK_LEN)
 				chunk = NULL;
-			}
 
 			npages -= 1 << cur_order;
 		} else {