diff options
author | Ingo Molnar <mingo@kernel.org> | 2017-08-25 11:07:13 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2017-08-25 11:07:13 +0200 |
commit | 3a9ff4fd04cc6ad199419508c8ea6eb839e0262d (patch) | |
tree | f3933b082ea1743e63e93a16190c6ce32175c96a /drivers/dma-buf/sync_file.c | |
parent | sched/completion: Document that reinit_completion() must be called after comp... (diff) | |
parent | Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dledfo... (diff) | |
download | linux-3a9ff4fd04cc6ad199419508c8ea6eb839e0262d.tar.xz linux-3a9ff4fd04cc6ad199419508c8ea6eb839e0262d.zip |
Merge branch 'linus' into sched/core, to pick up fixes
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers/dma-buf/sync_file.c')
-rw-r--r-- | drivers/dma-buf/sync_file.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c index d7e219d2669d..66fb40d0ebdb 100644 --- a/drivers/dma-buf/sync_file.c +++ b/drivers/dma-buf/sync_file.c @@ -304,7 +304,7 @@ static int sync_file_release(struct inode *inode, struct file *file) { struct sync_file *sync_file = file->private_data; - if (test_bit(POLL_ENABLED, &sync_file->fence->flags)) + if (test_bit(POLL_ENABLED, &sync_file->flags)) dma_fence_remove_callback(sync_file->fence, &sync_file->cb); dma_fence_put(sync_file->fence); kfree(sync_file); @@ -318,7 +318,8 @@ static unsigned int sync_file_poll(struct file *file, poll_table *wait) poll_wait(file, &sync_file->wq, wait); - if (!test_and_set_bit(POLL_ENABLED, &sync_file->fence->flags)) { + if (list_empty(&sync_file->cb.node) && + !test_and_set_bit(POLL_ENABLED, &sync_file->flags)) { if (dma_fence_add_callback(sync_file->fence, &sync_file->cb, fence_check_cb_func) < 0) wake_up_all(&sync_file->wq); |