Skip to content

Commit

Permalink
mm/shmem.c: clean code by removing unnecessary assignment
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mateusz Nosek authored and torvalds committed Apr 7, 2020
1 parent 27d80fa commit 343c3d7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions mm/shmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3120,12 +3120,9 @@ static int shmem_symlink(struct inode *dir, struct dentry *dentry, const char *s

error = security_inode_init_security(inode, dir, &dentry->d_name,
shmem_initxattrs, NULL);
if (error) {
if (error != -EOPNOTSUPP) {
iput(inode);
return error;
}
error = 0;
if (error && error != -EOPNOTSUPP) {
iput(inode);
return error;
}

inode->i_size = len-1;
Expand Down

0 comments on commit 343c3d7

Please sign in to comment.