projects
/
platform
/
kernel
/
linux-starfive.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
00e0afb
)
inotify: Fix error return code assignment flow.
author
youngjun
<her0gyugyu@gmail.com>
Sun, 26 Apr 2020 14:33:16 +0000
(07:33 -0700)
committer
Jan Kara
<jack@suse.cz>
Mon, 27 Apr 2020 10:14:56 +0000
(12:14 +0200)
If error code is initialized -EINVAL, there is no need to assign -EINVAL.
Link:
https://lore.kernel.org/r/20200426143316.29877-1-her0gyugyu@gmail.com
Signed-off-by: youngjun <her0gyugyu@gmail.com>
Signed-off-by: Jan Kara <jack@suse.cz>
fs/notify/inotify/inotify_user.c
patch
|
blob
|
history
diff --git
a/fs/notify/inotify/inotify_user.c
b/fs/notify/inotify/inotify_user.c
index
81ffc86
..
f88bbcc
100644
(file)
--- a/
fs/notify/inotify/inotify_user.c
+++ b/
fs/notify/inotify/inotify_user.c
@@
-764,20
+764,18
@@
SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
struct fsnotify_group *group;
struct inotify_inode_mark *i_mark;
struct fd f;
- int ret =
0
;
+ int ret =
-EINVAL
;
f = fdget(fd);
if (unlikely(!f.file))
return -EBADF;
/* verify that this is indeed an inotify instance */
- ret = -EINVAL;
if (unlikely(f.file->f_op != &inotify_fops))
goto out;
group = f.file->private_data;
- ret = -EINVAL;
i_mark = inotify_idr_find(group, wd);
if (unlikely(!i_mark))
goto out;