]> git.baikalelectronics.ru Git - kernel.git/commitdiff
habanalabs: patched cb equals user cb in device memset
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 22 Jan 2020 22:43:06 +0000 (00:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Mar 2020 12:00:11 +0000 (13:00 +0100)
[ Upstream commit 2a8dee34ee8b4b1a4ce045490cdf5d628823fe32 ]

During device memory memset, the driver allocates and use a CB (command
buffer). To reuse existing code, it keeps a pointer to the CB in two
variables, user_cb and patched_cb. Therefore, there is no need to "put"
both the user_cb and patched_cb, as it will cause an underflow of the
refcnt of the CB.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/goya/goya.c

index 1e97f6d77e3daa77528927b562601cc91e5855fc..13b39fd97429a9fc87715f69d827f86a74670f19 100644 (file)
@@ -4666,8 +4666,6 @@ static int goya_memset_device_memory(struct hl_device *hdev, u64 addr, u64 size,
 
        rc = goya_send_job_on_qman0(hdev, job);
 
-       hl_cb_put(job->patched_cb);
-
        hl_debugfs_remove_job(hdev, job);
        kfree(job);
        cb->cs_cnt--;