msm: synx: fix cleanup of fence during handle creation

Change removes the registered callback with the dma fence
if the handle allocation fails. This is explicitly needed
as any pending callbacks in the fence results in a warning
during destruction. Fix avoids such warning.

Change-Id: I1b5de820789d608231f7b5a9064bb1f0261d553e
Signed-off-by: Sumukh Hallymysore Ravindra <shallymy@codeaurora.org>
This commit is contained in:
Sumukh Hallymysore Ravindra 2020-08-14 09:07:09 +05:30
commit e903f12adc

View file

@ -163,7 +163,7 @@ int synx_create(struct synx_session session_id,
if (rc) {
pr_err("[sess: %u] error initializing synx obj\n",
client->id);
goto clean_up;
goto clear;
}
rc = synx_util_init_handle(client, synx_obj, &h_synx);
@ -180,7 +180,12 @@ int synx_create(struct synx_session session_id,
return 0;
clean_up:
dma_fence_put(synx_obj->fence);
if (!synx_util_is_external_object(synx_obj)) {
dma_fence_remove_callback(synx_obj->fence,
&synx_obj->fence_cb);
dma_fence_put(synx_obj->fence);
}
clear:
kfree(synx_obj);
fail:
synx_put_client(client);