]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
hpfs: fix a crash if hpfs_map_dnode_bitmap fails
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 25 May 2026 12:48:58 +0000 (14:48 +0200)
committerMikulas Patocka <mpatocka@redhat.com>
Mon, 25 May 2026 12:48:58 +0000 (14:48 +0200)
If hpfs_map_dnode_bitmap fails, the code would call hpfs_brelse4 on
uninitialized quad buffer head, causing a crash.

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Reported-by: Farhad Alemi <farhad.alemi@berkeley.edu>
Cc: stable@vger.kernel.org
fs/hpfs/alloc.c

index 66617b1557c647cf02256be1188dee63038e5f8e..f5150372618ede7078e0355bbde0d55cee701e9f 100644 (file)
@@ -372,8 +372,8 @@ int hpfs_check_free_dnodes(struct super_block *s, int n)
                                return 0;
                        }
                }
+               hpfs_brelse4(&qbh);
        }
-       hpfs_brelse4(&qbh);
        i = 0;
        if (hpfs_sb(s)->sb_c_bitmap != -1) {
                bmp = hpfs_map_bitmap(s, b, &qbh, "chkdn1");