Skip to content

Commit 7b26aa2

Browse files
youngjun-89jankara
authored andcommitted
inotify: Fix error return code assignment flow.
If error code is initialized -EINVAL, there is no need to assign -EINVAL. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: youngjun <[email protected]> Signed-off-by: Jan Kara <[email protected]>
1 parent 00e0afb commit 7b26aa2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

fs/notify/inotify/inotify_user.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -764,20 +764,18 @@ SYSCALL_DEFINE2(inotify_rm_watch, int, fd, __s32, wd)
764764
struct fsnotify_group *group;
765765
struct inotify_inode_mark *i_mark;
766766
struct fd f;
767-
int ret = 0;
767+
int ret = -EINVAL;
768768

769769
f = fdget(fd);
770770
if (unlikely(!f.file))
771771
return -EBADF;
772772

773773
/* verify that this is indeed an inotify instance */
774-
ret = -EINVAL;
775774
if (unlikely(f.file->f_op != &inotify_fops))
776775
goto out;
777776

778777
group = f.file->private_data;
779778

780-
ret = -EINVAL;
781779
i_mark = inotify_idr_find(group, wd);
782780
if (unlikely(!i_mark))
783781
goto out;

0 commit comments

Comments
 (0)