]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
habanalabs: use get_task_pid() to take PID
authorDani Liberman <dliberman@habana.ai>
Wed, 13 Apr 2022 18:32:02 +0000 (21:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 May 2022 19:01:18 +0000 (21:01 +0200)
find_get_pid() isn't good in case the user process was run inside
docker.

As a result, we didn't had the PID and we couldn't kill the user
process in case the device got stuck and we needed to reset the
device.

Signed-off-by: Dani Liberman <dliberman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/common/habanalabs_drv.c

index 28549d34d99ceddce36c741268901a3d198e0e6f..b85ca1e66eb21f064c8302d86a28dbada4323ae7 100644 (file)
@@ -237,7 +237,7 @@ int hl_device_open_ctrl(struct inode *inode, struct file *filp)
        hpriv->filp = filp;
        nonseekable_open(inode, filp);
 
-       hpriv->taskpid = find_get_pid(current->pid);
+       hpriv->taskpid = get_task_pid(current, PIDTYPE_PID);
 
        mutex_lock(&hdev->fpriv_ctrl_list_lock);