diff options
author | Mateusz Nosek <mateusznosek0@gmail.com> | 2020-04-06 20:07:54 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-04-07 10:43:41 -0700 |
commit | 343c3d7f0927e000427fae5e361aa560f83dd5b5 (patch) | |
tree | 926103b3d5c1d0e30238d46aa0b7afb14ba8e599 /mm/shmem.c | |
parent | 27d80fa24326b7b33c8ee7527843776e5df808a7 (diff) | |
download | lwn-343c3d7f0927e000427fae5e361aa560f83dd5b5.tar.gz lwn-343c3d7f0927e000427fae5e361aa560f83dd5b5.zip |
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>
Diffstat (limited to 'mm/shmem.c')
-rw-r--r-- | mm/shmem.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/mm/shmem.c b/mm/shmem.c index 97448a46a4dc..e23fea40767e 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -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; |