mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 14:21:47 +00:00
habanalabs: free signal handle on failure
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>
This commit is contained in:
parent
b166465452
commit
fee187fe46
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user