]> err.no Git - linux-2.6/blobdiff - lib/swiotlb.c
Blackfin arch: Optimization - no need to make additional math here
[linux-2.6] / lib / swiotlb.c
index c419ecf334c30a063374b0cced7cbad8afeed7bc..752fd95323f3d777496f93c2144c7e158d936789 100644 (file)
@@ -696,7 +696,7 @@ swiotlb_map_sg(struct device *hwdev, struct scatterlist *sgl, int nelems,
                                /* Don't panic here, we expect map_sg users
                                   to do proper error handling. */
                                swiotlb_full(hwdev, sg->length, dir, 0);
-                               swiotlb_unmap_sg(hwdev, sg - i, i, dir);
+                               swiotlb_unmap_sg(hwdev, sgl, i, dir);
                                sgl[0].dma_length = 0;
                                return 0;
                        }