summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2022-05-10 21:53:25 +0200
committerTom Rini <trini@konsulko.com>2022-06-06 17:47:17 -0400
commit84378d5c86d1b8e7afd2132e2c8d79d8e7e1f7d9 (patch)
tree34ef2872914679f5c2c7831b5980a11d14a0b756 /fs
parent89ab1e28173b7b23504ecd39e618fc73bbfd0371 (diff)
fs/squashfs: fix sqfs_read_sblk()
Setting sblk = NULL has no effect on the caller. We want to set *sblk = NULL if an error occurrs to avoid usage after free. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/squashfs/sqfs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/sqfs.c b/fs/squashfs/sqfs.c
index 547d2fd4b3..90bf32ca0a 100644
--- a/fs/squashfs/sqfs.c
+++ b/fs/squashfs/sqfs.c
@@ -49,7 +49,7 @@ static int sqfs_read_sblk(struct squashfs_super_block **sblk)
if (sqfs_disk_read(0, 1, *sblk) != 1) {
free(*sblk);
- sblk = NULL;
+ *sblk = NULL;
return -EINVAL;
}