mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
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 <[email protected]> Reviewed-by: Oded Gabbay <[email protected]> Signed-off-by: Oded Gabbay <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
This commit is contained in:
parent
93aef8e6cc
commit
1229d43396
1 changed files with 2 additions and 0 deletions
|
|
@ -959,6 +959,7 @@ again:
|
|||
GFP_KERNEL);
|
||||
if (!hdev->kernel_ctx) {
|
||||
rc = -ENOMEM;
|
||||
hl_mmu_fini(hdev);
|
||||
goto out_err;
|
||||
}
|
||||
|
||||
|
|
@ -970,6 +971,7 @@ again:
|
|||
"failed to init kernel ctx in hard reset\n");
|
||||
kfree(hdev->kernel_ctx);
|
||||
hdev->kernel_ctx = NULL;
|
||||
hl_mmu_fini(hdev);
|
||||
goto out_err;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue