From patchwork Wed Mar 17 22:53:04 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 86573 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 o2HMsLi5025837 for ; Wed, 17 Mar 2010 22:54:21 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754231Ab0CQWyU (ORCPT ); Wed, 17 Mar 2010 18:54:20 -0400 Received: from 132.79-246-81.adsl-static.isp.belgacom.be ([81.246.79.132]:35601 "EHLO viper.mind.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750960Ab0CQWyU (ORCPT ); Wed, 17 Mar 2010 18:54:20 -0400 Received: from [172.16.0.10] (helo=localhost.localdomain) by viper.mind.be with esmtp (Exim 4.69) (envelope-from ) id 1Ns27q-0002P2-Vd; Wed, 17 Mar 2010 23:54:19 +0100 From: Arnout Vandecappelle To: linux-media@vger.kernel.org, mchehab@infradead.org, arnout@mind.be Subject: [PATCH 1/2] V4L/DVB: buf-dma-sg.c: don't assume nr_pages == sglen Date: Wed, 17 Mar 2010 23:53:04 +0100 Message-Id: <1268866385-15692-2-git-send-email-arnout@mind.be> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1268866385-15692-1-git-send-email-arnout@mind.be> References: <1268866385-15692-1-git-send-email-arnout@mind.be> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@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]); Wed, 17 Mar 2010 22:54:21 +0000 (UTC) diff --git a/drivers/media/video/videobuf-dma-sg.c b/drivers/media/video/videobuf-dma-sg.c index da1790e..18aaf54 100644 --- a/drivers/media/video/videobuf-dma-sg.c +++ b/drivers/media/video/videobuf-dma-sg.c @@ -262,7 +262,7 @@ int videobuf_dma_sync(struct videobuf_queue *q, struct videobuf_dmabuf *dma) MAGIC_CHECK(dma->magic, MAGIC_DMABUF); BUG_ON(!dma->sglen); - dma_sync_sg_for_cpu(q->dev, dma->sglist, dma->nr_pages, dma->direction); + dma_sync_sg_for_cpu(q->dev, dma->sglist, dma->sglen, dma->direction); return 0; } @@ -272,7 +272,7 @@ int videobuf_dma_unmap(struct videobuf_queue* q,struct videobuf_dmabuf *dma) if (!dma->sglen) return 0; - dma_unmap_sg(q->dev, dma->sglist, dma->nr_pages, dma->direction); + dma_unmap_sg(q->dev, dma->sglist, dma->sglen, dma->direction); kfree(dma->sglist); dma->sglist = NULL;