Skip to content

Commit e659522

Browse files
nkiryushinjankara
authored andcommitted
fanotify: remove unneeded sub-zero check for unsigned value
Unsigned size_t len in copy_fid_info_to_user is checked for negative value. This check is redundant as it is always false. Found by Linux Verification Center (linuxtesting.org) with SVACE. Fixes: 5e469c8 ("fanotify: copy event fid info to user") Signed-off-by: Nikita Kiryushin <[email protected]> Signed-off-by: Jan Kara <[email protected]> Message-Id: <[email protected]>
1 parent 4cece76 commit e659522

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/notify/fanotify/fanotify_user.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ static int copy_fid_info_to_user(__kernel_fsid_t *fsid, struct fanotify_fh *fh,
502502
}
503503

504504
/* Pad with 0's */
505-
WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
505+
WARN_ON_ONCE(len >= FANOTIFY_EVENT_ALIGN);
506506
if (len > 0 && clear_user(buf, len))
507507
return -EFAULT;
508508

0 commit comments

Comments
 (0)