We need to use dma_free_coherent() instead of kfree() in mite_free_ring()
authorFrank Mori Hess <fmhess@speakeasy.net>
Thu, 9 Aug 2007 00:22:00 +0000 (00:22 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Thu, 9 Aug 2007 00:22:00 +0000 (00:22 +0000)
now.

comedi/drivers/mite.h

index 1f9e4d3747f8746f41a1db0a934ee66764f7a976..07d9a3e0ac304e4f1bd706275e6ea48988ab62a6 100644 (file)
@@ -100,8 +100,12 @@ static inline void mite_free_ring(struct mite_dma_descriptor_ring *ring)
 {
        if(ring)
        {
-               if(ring->descriptors) kfree(ring->descriptors);
-               if(ring->hw_dev) put_device(ring->hw_dev);
+               if(ring->descriptors)
+               {
+                       dma_free_coherent(ring->hw_dev, ring->n_links * sizeof(struct mite_dma_descriptor),
+                               ring->descriptors, ring->descriptors_dma_addr);
+               }
+               put_device(ring->hw_dev);
                kfree(ring);
        }
 };