diff options
author | Oded Gabbay <ogabbay@kernel.org> | 2021-11-30 23:08:21 +0200 |
---|---|---|
committer | Oded Gabbay <ogabbay@kernel.org> | 2021-12-26 08:59:08 +0200 |
commit | 5b90e59d55d94aa939fae941db4a0e613e6ecc1e (patch) | |
tree | e3226113771d41c167d633b5db227728f3e68b92 /drivers/misc/habanalabs/common/habanalabs_drv.c | |
parent | 4337b50b5fe5ee64c821790f601ee6153bb9f027 (diff) |
habanalabs: remove compute context pointer
It was an error to save the compute context's pointer in the device
structure, as it allowed its use without proper ref-cnt.
Change the variable to a flag that only indicates whether there is
an active compute context. Code that needs the pointer will now
be forced to use proper internal APIs to get the pointer.
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Diffstat (limited to 'drivers/misc/habanalabs/common/habanalabs_drv.c')
-rw-r--r-- | drivers/misc/habanalabs/common/habanalabs_drv.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/habanalabs/common/habanalabs_drv.c b/drivers/misc/habanalabs/common/habanalabs_drv.c index d4ef99952d15..62a02ef43bb7 100644 --- a/drivers/misc/habanalabs/common/habanalabs_drv.c +++ b/drivers/misc/habanalabs/common/habanalabs_drv.c @@ -161,7 +161,7 @@ int hl_device_open(struct inode *inode, struct file *filp) goto out_err; } - if (hdev->compute_ctx) { + if (hdev->is_compute_ctx_active) { dev_dbg_ratelimited(hdev->dev, "Can't open %s because another user is working on it\n", dev_name(hdev->dev)); |