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)
committerOded Gabbay <ogabbay@kernel.org>
Tue, 29 Dec 2020 21:23:12 +0000 (23:23 +0200)
commitb000700d6db50c933ce8b661154e26cf4ad06dba
treefd0d09aef76a841985c775e37fdde209f14455fd
parent097c62b6f0ec2bdadf86afbe80df03856338724d
habanalabs: Fix memleak in hl_device_reset

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>
drivers/misc/habanalabs/common/device.c