summaryrefslogtreecommitdiff
path: root/drivers/misc
diff options
context:
space:
mode:
authorTomer Tayar <ttayar@habana.ai>2021-02-19 14:05:33 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-03-30 14:31:50 +0200
commiteb4154fb61e210b4a3b3c1a4b0e045c7d516255b (patch)
tree52178c9929f15bc3817326203668dbf39efa8986 /drivers/misc
parentf2b38f03a3f71c30c77a4516b26c8bea13cc08ce (diff)
habanalabs: Call put_pid() when releasing control device
[ Upstream commit 27ac5aada024e0821c86540ad18f37edadd77d5e ] The refcount of the "hl_fpriv" structure is not used for the control device, and thus hl_hpriv_put() is not called when releasing this device. This results with no call to put_pid(), so add it explicitly in hl_device_release_ctrl(). Signed-off-by: Tomer Tayar <ttayar@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>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/habanalabs/common/device.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c
index 71b3a4d5adc6..7b0bf470795c 100644
--- a/drivers/misc/habanalabs/common/device.c
+++ b/drivers/misc/habanalabs/common/device.c
@@ -106,6 +106,8 @@ static int hl_device_release_ctrl(struct inode *inode, struct file *filp)
list_del(&hpriv->dev_node);
mutex_unlock(&hdev->fpriv_list_lock);
+ put_pid(hpriv->taskpid);
+
kfree(hpriv);
return 0;