accel/habanalabs: add missing error flow in hl_sysfs_init()
authorTomer Tayar <ttayar@habana.ai>
Sun, 2 Apr 2023 10:42:35 +0000 (13:42 +0300)
committerOded Gabbay <ogabbay@kernel.org>
Sat, 8 Apr 2023 07:44:23 +0000 (10:44 +0300)
commit56499c461589634f2c89ffbd9cfb78268191d349
tree7b151e0ecba26407cd9d75be5d08cf167d02b32b
parent31420f93b5c15746759cd87eaa0f572a7316ea46
accel/habanalabs: add missing error flow in hl_sysfs_init()

hl_sysfs_fini() is called only if hl_sysfs_init() completes
successfully. Therefore if hl_sysfs_init() fails, need to remove any
sysfs group that was added until that point.

Signed-off-by: Tomer Tayar <ttayar@habana.ai>
Reviewed-by: Oded Gabbay <ogabbay@kernel.org>
Signed-off-by: Oded Gabbay <ogabbay@kernel.org>
drivers/accel/habanalabs/common/sysfs.c