From: Tomer Tayar Date: Fri, 19 Feb 2021 12:05:33 +0000 (+0200) Subject: habanalabs: Call put_pid() when releasing control device X-Git-Tag: accepted/tizen/unified/20230118.172025~7644^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27ac5aada024e0821c86540ad18f37edadd77d5e;p=platform%2Fkernel%2Flinux-rpi.git habanalabs: Call put_pid() when releasing control device 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 Reviewed-by: Oded Gabbay Signed-off-by: Oded Gabbay --- diff --git a/drivers/misc/habanalabs/common/device.c b/drivers/misc/habanalabs/common/device.c index 15fcb5c..9ecd805 100644 --- a/drivers/misc/habanalabs/common/device.c +++ b/drivers/misc/habanalabs/common/device.c @@ -117,6 +117,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;