Skip to content

Commit 343c3d7

Browse files
Mateusz Nosektorvalds
authored andcommitted
mm/shmem.c: clean code by removing unnecessary assignment
Previously 0 was assigned to variable 'error' but the variable was never read before reassignemnt later. So the assignment can be removed. Signed-off-by: Mateusz Nosek <mateusznosek0@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Reviewed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Acked-by: Pankaj Gupta <pankaj.gupta.linux@gmail.com> Cc: Hugh Dickins <hughd@google.com> Link: http://lkml.kernel.org/r/20200301152832.24595-1-mateusznosek0@gmail.com Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 27d80fa commit 343c3d7

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

mm/shmem.c

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3120,12 +3120,9 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s
31203120

31213121
error = security_inode_init_security(inode, dir, &dentry->d_name,
31223122
shmem_initxattrs, NULL);
3123-
if (error) {
3124-
if (error != -EOPNOTSUPP) {
3125-
iput(inode);
3126-
return error;
3127-
}
3128-
error = 0;
3123+
if (error && error != -EOPNOTSUPP) {
3124+
iput(inode);
3125+
return error;
31293126
}
31303127

31313128
inode->i_size = len-1;

0 commit comments

Comments
 (0)