]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
habanalabs: Fix memleak in hl_device_reset
authorDinghao Liu <dinghao.liu@zju.edu.cn>
Sat, 26 Dec 2020 07:27:14 +0000 (15:27 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 19 Jan 2021 17:26:15 +0000 (18:26 +0100)
commit1229d433960cd91140ba2c318867cca7f3e270c3
tree293c76af255c8a4e92298dcb55836d87fb63d410
parent93aef8e6cc08391d5c288177dcb46fe1fd88f240
habanalabs: Fix memleak in hl_device_reset

[ Upstream commit b000700d6db50c933ce8b661154e26cf4ad06dba ]

When kzalloc() fails, we should execute hl_mmu_fini()
to release the MMU module. It's the same when
hl_ctx_init() fails.

Signed-off-by: Dinghao Liu <dinghao.liu@zju.edu.cn>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/habanalabs/device.c