summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/video-buf.c
diff options
context:
space:
mode:
Diffstat (limited to 'linux/drivers/media/video/video-buf.c')
-rw-r--r--linux/drivers/media/video/video-buf.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/linux/drivers/media/video/video-buf.c b/linux/drivers/media/video/video-buf.c
index 58352a563..6684dbc54 100644
--- a/linux/drivers/media/video/video-buf.c
+++ b/linux/drivers/media/video/video-buf.c
@@ -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.
@@ -222,9 +222,18 @@ int videobuf_dma_pci_map(struct pci_dev *dev, struct videobuf_dmabuf *dma)
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;
}