On 1/22/20 12:34 AM, Luben Tuikov wrote:

+               for (j = 0; j < amdgpu_ctx_num_entities[i]; ++j) {
+                       struct amdgpu_ctx_entity *entity = &ctx->entities[i][j];
- kfree(entity->fences);
-               entity->fences = NULL;
+                       kfree(entity->fences);
+                       entity->fences = NULL;
+               }
+
+error_cleanup_entity_memory:
"cleanup" refers to something spilled, or something to be collected.
It is  collecting memory.
(Or winning in a wagered game of chance.) Also at "module_exit", maybe.

The kernel has traditionally used "unroll" and "free" for this. Now, since
you're unrolling the loop (notice that it sits after the "return 0;"), then
you can backtrack and name it like this:

Error_unroll_free1:
        for ( ; i >= 0; i--)
                free(my_array[i]);

I prefer the existing style makes it more readable.


Regards,

Nirmoy

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reply via email to