diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2012-02-20 17:53:05 -0500 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2012-02-20 17:53:05 -0500 |
commit | 4fda400360e6c15b9dea4351f2ad85845cdfda7e (patch) | |
tree | e8759a08bd2bd0947477a22b6550477ca9c03932 /fs/ext4/dir.c | |
parent | f1b3a2a75356ce9fdcbedd79d2bb0d1ca8ed9cee (diff) |
ext4: remove an unneeded NULL check in __ext4_check_dir_entry()
We dereference "bh" unconditionally a couple lines down to find
"by->b_size". This function is never called with a NULL "bh" so I have
removed the check.
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'fs/ext4/dir.c')
-rw-r--r-- | fs/ext4/dir.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/ext4/dir.c b/fs/ext4/dir.c index 164c56092e58..a4a0234cb5cb 100644 --- a/fs/ext4/dir.c +++ b/fs/ext4/dir.c | |||
@@ -91,17 +91,17 @@ int __ext4_check_dir_entry(const char *function, unsigned int line, | |||
91 | return 0; | 91 | return 0; |
92 | 92 | ||
93 | if (filp) | 93 | if (filp) |
94 | ext4_error_file(filp, function, line, bh ? bh->b_blocknr : 0, | 94 | ext4_error_file(filp, function, line, bh->b_blocknr, |
95 | "bad entry in directory: %s - offset=%u(%u), " | 95 | "bad entry in directory: %s - offset=%u(%u), " |
96 | "inode=%u, rec_len=%d, name_len=%d", | 96 | "inode=%u, rec_len=%d, name_len=%d", |
97 | error_msg, (unsigned) (offset%bh->b_size), | 97 | error_msg, (unsigned) (offset % bh->b_size), |
98 | offset, le32_to_cpu(de->inode), | 98 | offset, le32_to_cpu(de->inode), |
99 | rlen, de->name_len); | 99 | rlen, de->name_len); |
100 | else | 100 | else |
101 | ext4_error_inode(dir, function, line, bh ? bh->b_blocknr : 0, | 101 | ext4_error_inode(dir, function, line, bh->b_blocknr, |
102 | "bad entry in directory: %s - offset=%u(%u), " | 102 | "bad entry in directory: %s - offset=%u(%u), " |
103 | "inode=%u, rec_len=%d, name_len=%d", | 103 | "inode=%u, rec_len=%d, name_len=%d", |
104 | error_msg, (unsigned) (offset%bh->b_size), | 104 | error_msg, (unsigned) (offset % bh->b_size), |
105 | offset, le32_to_cpu(de->inode), | 105 | offset, le32_to_cpu(de->inode), |
106 | rlen, de->name_len); | 106 | rlen, de->name_len); |
107 | 107 | ||