Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
[linux-2.6-microblaze.git] / drivers / dma-buf / sw_sync.c
index 38cc738..24f83f9 100644 (file)
@@ -321,8 +321,16 @@ static int sw_sync_debugfs_open(struct inode *inode, struct file *file)
 static int sw_sync_debugfs_release(struct inode *inode, struct file *file)
 {
        struct sync_timeline *obj = file->private_data;
+       struct sync_pt *pt, *next;
+
+       spin_lock_irq(&obj->lock);
+
+       list_for_each_entry_safe(pt, next, &obj->pt_list, link) {
+               dma_fence_set_error(&pt->base, -ENOENT);
+               dma_fence_signal_locked(&pt->base);
+       }
 
-       smp_wmb();
+       spin_unlock_irq(&obj->lock);
 
        sync_timeline_put(obj);
        return 0;