habanalabs: fix use-after-free bug
authorOded Gabbay <ogabbay@kernel.org>
Sun, 30 Jan 2022 15:39:54 +0000 (17:39 +0200)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 28 Feb 2022 12:22:04 +0000 (14:22 +0200)
commit57b6f02fff3e2a8c394bbde6724950d492160356
tree65f8380f153d27273ec8e2743ade9de76e3ecf91
parent2a835946ee49462fc18eb6db9b53be789acaf2e5
habanalabs: fix use-after-free bug

When the code iterates over the free list of physical pages nodes, it
deletes the physical page node which is used as the iterator.

Therefore, we need to use the safe version of the iteration to prevent
use-after-free.

Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/memory.c