selinux: clean up selinuxfs resources on init failure

init_sel_fs() creates the selinuxfs mount point and registers the
filesystem before mounting selinuxfs internally. If kern_mount()
or the subsequent lookup of the null file fails, the function
returns without undoing the resources that were already registered.

Add the missing error unwinding so the internal mount, filesystem
registration, and sysfs mount point are released as appropriate.

Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Acked-by: Stephen Smalley <stephen.smalley.work@gmail.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
Haoxiang Li 2026-06-22 22:37:22 +08:00 • committed by Paul Moore
commit dc67c654bc