habanalabs: initialize hpriv fields before adding new node
authorMoti Haimovski <mhaimovski@habana.ai>
Mon, 16 Aug 2021 11:39:46 +0000 (14:39 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Mon, 18 Oct 2021 09:05:47 +0000 (12:05 +0300)
commit4a18dde5e4c6348d48e3021cfbb01ef699005f19
tree98e2eebdb4936e045191b71b8e0fd99e9ad73c05
parent024b7b1d6dcd1960e9b669e981968ca4b6bf80cb
habanalabs: initialize hpriv fields before adding new node

When adding a new node to the hpriv list, the driver should
initialize its fields before adding the new node.

Otherwise, there may be some small chance of another thread traversing
that list and accessing the new node's fields without them being
initialized.

Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/misc/habanalabs/common/habanalabs_drv.c