[PATCH] qnx6: Release the MMI superblock buffer on mount failure

From: Haoxiang Li

Date: Wed Dec 02 2026 - 01:09:17 EST


qnx6_mmi_fill_super() stores the active superblock buffer in
qs->sb_buf after releasing the inactive buffer. If subsequent
validation or root setup fails, qnx6_fill_super() leaks the active
buffer because both local buffer pointers remain NULL.

Assign qs->sb_buf to bh1 after qnx6_mmi_fill_super() succeeds,
allowing the existing error path to release the active buffer
without introducing additional cleanup logic.

Fixes: 5d026c724220 ("fs: initial qnx6fs addition")
Signed-off-by: Haoxiang Li <haoxiang_li2024@xxxxxxx>
---
I noticed that Hui Peng previously submitted a patch addressing the
same issue, but with a different fix. I think the fix can be done
in a simpler way with reusing the existing cleanup logic, so I submit
it separately.

Previous patch:
https://lore.kernel.org/all/20260930081947.511613-4-benquike@xxxxxxxxx/
---
fs/qnx6/inode.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/fs/qnx6/inode.c b/fs/qnx6/inode.c
index 6de49333acad..81d74d32bac9 100644
--- a/fs/qnx6/inode.c
+++ b/fs/qnx6/inode.c
@@ -316,10 +316,11 @@ static int qnx6_fill_super(struct super_block *s, struct fs_context *fc)

if (qs->s_mount_opt == QNX6_MOUNT_MMI_FS) {
sb1 = qnx6_mmi_fill_super(s, silent);
- if (sb1)
- goto mmi_success;
- else
+ if (!sb1)
goto outnobh;
+
+ bh1 = qs->sb_buf;
+ goto mmi_success;
}
sbi = QNX6_SB(s);
sbi->s_bytesex = BYTESEX_LE;
--
2.25.1