habanalabs: remove node from list before freeing the node

fix the following smatch warnings:

goya_pin_memory_before_cs()
warn: '&userptr->job_node' not removed from list

gaudi_pin_memory_before_cs()
warn: '&userptr->job_node' not removed from list

Signed-off-by: Koby Elbaz <kelbaz@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
This commit is contained in:
Koby Elbaz 2021-06-09 21:43:52 +03:00 committed by Oded Gabbay
parent 11d5cb8b95
commit f5eb7bf0c4
2 changed files with 2 additions and 0 deletions

View File

@ -5046,6 +5046,7 @@ already_pinned:
return 0;
unpin_memory:
list_del(&userptr->job_node);
hl_unpin_host_memory(hdev, userptr);
free_userptr:
kfree(userptr);

View File

@ -3326,6 +3326,7 @@ already_pinned:
return 0;
unpin_memory:
list_del(&userptr->job_node);
hl_unpin_host_memory(hdev, userptr);
free_userptr:
kfree(userptr);