.. | .. |
---|
1604 | 1604 | if (!kcpu_fence) |
---|
1605 | 1605 | return -ENOMEM; |
---|
1606 | 1606 | |
---|
| 1607 | + /* Set reference to KCPU metadata and increment refcount */ |
---|
| 1608 | + kcpu_fence->metadata = kcpu_queue->metadata; |
---|
| 1609 | + WARN_ON(!kbase_refcount_inc_not_zero(&kcpu_fence->metadata->refcount)); |
---|
| 1610 | + |
---|
1607 | 1611 | #if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE) |
---|
1608 | 1612 | fence_out = (struct fence *)kcpu_fence; |
---|
1609 | 1613 | #else |
---|
.. | .. |
---|
1624 | 1628 | */ |
---|
1625 | 1629 | dma_fence_get(fence_out); |
---|
1626 | 1630 | #endif |
---|
1627 | | - |
---|
1628 | | - /* Set reference to KCPU metadata and increment refcount */ |
---|
1629 | | - kcpu_fence->metadata = kcpu_queue->metadata; |
---|
1630 | | - WARN_ON(!kbase_refcount_inc_not_zero(&kcpu_fence->metadata->refcount)); |
---|
1631 | 1631 | |
---|
1632 | 1632 | /* create a sync_file fd representing the fence */ |
---|
1633 | 1633 | *sync_file = sync_file_create(fence_out); |
---|