From patchwork Fri Apr 30 11:21:31 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sebastien dugue X-Patchwork-Id: 96023 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o3UJHc1W007196 for ; Fri, 30 Apr 2010 19:17:47 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759520Ab0D3TQf (ORCPT ); Fri, 30 Apr 2010 15:16:35 -0400 Received: from ecfrec.frec.bull.fr ([129.183.4.8]:48686 "EHLO ecfrec.frec.bull.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757630Ab0D3QzN (ORCPT ); Fri, 30 Apr 2010 12:55:13 -0400 Received: from cyclope.frec.bull.fr (cyclope.frec.bull.fr [129.183.4.9]) by ecfrec.frec.bull.fr (Postfix) with ESMTP id 0FDDE6F59E; Fri, 30 Apr 2010 13:24:23 +0200 (CEST) Received: from frecb007965 (frecb007965.frec.bull.fr [129.183.101.36]) by cyclope.frec.bull.fr (Postfix) with ESMTP id 0D23F27294; Fri, 30 Apr 2010 13:24:21 +0200 (CEST) Date: Fri, 30 Apr 2010 13:21:31 +0200 From: sebastien dugue To: linux-rdma Cc: Roland Dreier Subject: [PATCH] mlx4: Fix chunk sg list overflow in mlx4_alloc_icm() Message-ID: <20100430132131.0d829b3c@frecb007965> Organization: BULL X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 30 Apr 2010 19:17:48 +0000 (UTC) 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 {