Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261967AbVCHKq0 (ORCPT ); Tue, 8 Mar 2005 05:46:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261971AbVCHKpu (ORCPT ); Tue, 8 Mar 2005 05:45:50 -0500 Received: from hirsch.in-berlin.de ([192.109.42.6]:10731 "EHLO hirsch.in-berlin.de") by vger.kernel.org with ESMTP id S261967AbVCHKpP (ORCPT ); Tue, 8 Mar 2005 05:45:15 -0500 X-Envelope-From: kraxel@bytesex.org Date: Tue, 8 Mar 2005 11:44:37 +0100 From: Gerd Knorr To: Andrew Morton , Linux Kernel Mailing List Subject: [patch] v4l: video-buf update Message-ID: <20050308104437.GA30696@bytesex> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.6i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1420 Lines: 45 Bugfix: catch pci_map_sg() failures. Signed-off-by: Gerd Knorr --- drivers/media/video/video-buf.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-) diff -u linux-2.6.11/drivers/media/video/video-buf.c linux/drivers/media/video/video-buf.c --- linux-2.6.11/drivers/media/video/video-buf.c 2005-03-07 10:13:55.000000000 +0100 +++ linux/drivers/media/video/video-buf.c 2005-03-07 16:38:38.000000000 +0100 @@ -1,5 +1,5 @@ /* - * $Id: video-buf.c,v 1.17 2004/12/10 12:33:40 kraxel Exp $ + * $Id: video-buf.c,v 1.18 2005/02/24 13:32:30 kraxel Exp $ * * generic helper functions for video4linux capture buffers, to handle * memory management and PCI DMA. Right now bttv + saa7134 use it. @@ -217,9 +217,18 @@ return -ENOMEM; } - if (!dma->bus_addr) + if (!dma->bus_addr) { dma->sglen = pci_map_sg(dev,dma->sglist,dma->nr_pages, dma->direction); + if (0 == dma->sglen) { + printk(KERN_WARNING + "%s: pci_map_sg failed\n",__FUNCTION__); + kfree(dma->sglist); + dma->sglist = NULL; + dma->sglen = 0; + return -EIO; + } + } return 0; } -- #define printk(args...) fprintf(stderr, ## args) - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/