]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/dma/ioat/dma.c
ioat: ioat_alloc_ring() failure handling.
[mirror_ubuntu-bionic-kernel.git] / drivers / dma / ioat / dma.c
index 58d4ccd33672081bcce087d8e24b828f53b83ac7..b4e796181331c22db2facf8ec1c53483185f027d 100644 (file)
@@ -388,10 +388,11 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags)
 
                descs->virt = dma_alloc_coherent(to_dev(ioat_chan),
                                                 SZ_2M, &descs->hw, flags);
-               if (!descs->virt && (i > 0)) {
+               if (!descs->virt) {
                        int idx;
 
                        for (idx = 0; idx < i; idx++) {
+                               descs = &ioat_chan->descs[idx];
                                dma_free_coherent(to_dev(ioat_chan), SZ_2M,
                                                  descs->virt, descs->hw);
                                descs->virt = NULL;