hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/drivers/gpu/arm/bifrost/csf/mali_kbase_csf_kcpu.c
....@@ -1604,6 +1604,10 @@
16041604 if (!kcpu_fence)
16051605 return -ENOMEM;
16061606
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
+
16071611 #if (KERNEL_VERSION(4, 10, 0) > LINUX_VERSION_CODE)
16081612 fence_out = (struct fence *)kcpu_fence;
16091613 #else
....@@ -1624,10 +1628,6 @@
16241628 */
16251629 dma_fence_get(fence_out);
16261630 #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));
16311631
16321632 /* create a sync_file fd representing the fence */
16331633 *sync_file = sync_file_create(fence_out);