]> git.baikalelectronics.ru Git - kernel.git/commit
habanalabs: fix missing handle shift during mmap
authorYuri Nudelman <ynudelman@habana.ai>
Sun, 15 May 2022 10:46:37 +0000 (13:46 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 22 May 2022 19:01:21 +0000 (21:01 +0200)
commite98a5485434755dab631ecbd2dd81e03a0e2ba25
treef3f8a4e7de88e607304501b815734a047493062e
parent31181f05319eefc0ce906e3ac55b85a53f321443
habanalabs: fix missing handle shift during mmap

During mmap operation on the unified memory manager buffer, the vma
page offset is shifted to extract the handle value. Due to a typo, it
was not shifted back at the end. That could cause the offset to be
modified after mmap operation, that may affect subsequent operations.
In addition, in allocation flow, in case of out of memory error, idr
would not be correctly destroyed, again because of a missing shift.

Signed-off-by: Yuri Nudelman <ynudelman@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/habanalabs/common/memory_mgr.c