Skip to content

Commit

Permalink
habanalabs: remove node from list before freeing the node
Browse files Browse the repository at this point in the history
[ Upstream commit f5eb7bf ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
KobyElbaz authored and gregkh committed Jul 20, 2021
1 parent cce27a7 commit 29d01e4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions drivers/misc/habanalabs/gaudi/gaudi.c
Expand Up @@ -4934,6 +4934,7 @@ static int gaudi_pin_memory_before_cs(struct hl_device *hdev,
return 0;

unpin_memory:
list_del(&userptr->job_node);
hl_unpin_host_memory(hdev, userptr);
free_userptr:
kfree(userptr);
Expand Down
1 change: 1 addition & 0 deletions drivers/misc/habanalabs/goya/goya.c
Expand Up @@ -3270,6 +3270,7 @@ static int goya_pin_memory_before_cs(struct hl_device *hdev,
return 0;

unpin_memory:
list_del(&userptr->job_node);
hl_unpin_host_memory(hdev, userptr);
free_userptr:
kfree(userptr);
Expand Down

0 comments on commit 29d01e4

Please sign in to comment.