projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b166465
)
habanalabs: free signal handle on failure
author
Oded Gabbay
<ogabbay@kernel.org>
Tue, 30 Nov 2021 12:54:53 +0000
(14:54 +0200)
committer
Oded Gabbay
<ogabbay@kernel.org>
Sun, 26 Dec 2021 06:59:08 +0000
(08:59 +0200)
Fix a bug where in case of failure to allocate idr, the handle's
memory wasn't freed as part of the error handling code.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/command_submission.c
patch
|
blob
|
history
diff --git
a/drivers/misc/habanalabs/common/command_submission.c
b/drivers/misc/habanalabs/common/command_submission.c
index 8be547b0926c90282dc333eff02d73d6cd83c528..d169418197c02c7b3072ad79643e3900e1b82fd0 100644
(file)
--- a/
drivers/misc/habanalabs/common/command_submission.c
+++ b/
drivers/misc/habanalabs/common/command_submission.c
@@
-1838,7
+1838,7
@@
static int cs_ioctl_reserve_signals(struct hl_fpriv *hpriv,
if (hdl_id < 0) {
dev_err(hdev->dev, "Failed to allocate IDR for a new signal reservation\n");
rc = -EINVAL;
- goto
out
;
+ goto
free_handle
;
}
handle->id = hdl_id;
@@
-1891,7
+1891,9
@@
remove_idr:
idr_remove(&mgr->handles, hdl_id);
spin_unlock(&mgr->lock);
+free_handle:
kfree(handle);
+
out:
return rc;
}