diff -r a8b2a0738f4e linux/drivers/media/common/saa7146_core.c --- a/linux/drivers/media/common/saa7146_core.c Thu Apr 19 17:07:37 2007 -0300 +++ b/linux/drivers/media/common/saa7146_core.c Sat Apr 28 20:55:30 2007 +0100 @@ -152,6 +152,7 @@ char *saa7146_vmalloc_build_pgtable(stru return NULL; } + pt->nents = pages; slen = pci_map_sg(pci,pt->slist,pages,PCI_DMA_FROMDEVICE); if (0 != saa7146_pgtable_build_single(pci, pt, pt->slist, slen)) { return NULL; @@ -165,6 +166,7 @@ void saa7146_pgtable_free(struct pci_dev if (NULL == pt->cpu) return; pci_free_consistent(pci, pt->size, pt->cpu, pt->dma); + pci_unmap_sg(pci, pt->slist, pt->nents, PCI_DMA_FROMDEVICE); pt->cpu = NULL; kfree(pt->slist); pt->slist = NULL; diff -r a8b2a0738f4e linux/include/media/saa7146.h --- a/linux/include/media/saa7146.h Thu Apr 19 17:07:37 2007 -0300 +++ b/linux/include/media/saa7146.h Sat Apr 28 18:06:47 2007 +0100 @@ -70,6 +70,7 @@ struct saa7146_pgtable { unsigned long offset; /* used for custom pagetables (used for example by budget dvb cards) */ struct scatterlist *slist; + int nents; }; struct saa7146_pci_extension_data {