aboutsummaryrefslogtreecommitdiff
path: root/fs/squashfs/sqfs_inode.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-09-19 08:31:52 -0400
committerTom Rini <trini@konsulko.com>2020-09-19 08:31:52 -0400
commit667ab37d586e702bc745934afff3dae2f67a2257 (patch)
treedbd488a96e815e5604339d6c6fa1d34ca4179d72 /fs/squashfs/sqfs_inode.c
parent98f3ee09d096c6c1bc49e08d805f6354dffb0e59 (diff)
parent9989fb18bd5b6e2afe5f296b4c414f8d1c73d527 (diff)
Merge branch '2020-09-18-assorted-bugfixes'
- SquashFS Coverity fixes - bitflip fix in the alternate memtest command - Disable networking on bcmstb boards where we didn't have any network drivers enabled.
Diffstat (limited to 'fs/squashfs/sqfs_inode.c')
-rw-r--r--fs/squashfs/sqfs_inode.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/squashfs/sqfs_inode.c b/fs/squashfs/sqfs_inode.c
index 1387779a85..1368f3063c 100644
--- a/fs/squashfs/sqfs_inode.c
+++ b/fs/squashfs/sqfs_inode.c
@@ -142,8 +142,11 @@ int sqfs_read_metablock(unsigned char *file_mapping, int offset,
u16 header;
data = file_mapping + offset;
+ if (!data)
+ return -EFAULT;
+
header = get_unaligned((u16 *)data);
- if (!header || !data)
+ if (!header)
return -EINVAL;
*compressed = SQFS_COMPRESSED_METADATA(header);