Commit 381cebfe authored by Dan Carpenter's avatar Dan Carpenter Committed by Theodore Ts'o

ext4: silence array overflow warning

I get a static checker warning:

    fs/ext4/ext4.h:3091 ext4_set_de_type()
    error: buffer overflow 'ext4_type_by_mode' 15 <= 15

It seems unlikely that we would hit this read overflow in real life, but
it's also simple enough to make the array 16 bytes instead of 15.
Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
parent fcf5ea10
...@@ -3072,7 +3072,7 @@ extern int ext4_handle_dirty_dirent_node(handle_t *handle, ...@@ -3072,7 +3072,7 @@ extern int ext4_handle_dirty_dirent_node(handle_t *handle,
struct inode *inode, struct inode *inode,
struct buffer_head *bh); struct buffer_head *bh);
#define S_SHIFT 12 #define S_SHIFT 12
static const unsigned char ext4_type_by_mode[S_IFMT >> S_SHIFT] = { static const unsigned char ext4_type_by_mode[(S_IFMT >> S_SHIFT) + 1] = {
[S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE, [S_IFREG >> S_SHIFT] = EXT4_FT_REG_FILE,
[S_IFDIR >> S_SHIFT] = EXT4_FT_DIR, [S_IFDIR >> S_SHIFT] = EXT4_FT_DIR,
[S_IFCHR >> S_SHIFT] = EXT4_FT_CHRDEV, [S_IFCHR >> S_SHIFT] = EXT4_FT_CHRDEV,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment