linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: zhengbin <zhengbin13@huawei.com>
To: <amir73il@gmail.com>, <jack@suse.cz>, <linux-fsdevel@vger.kernel.org>
Cc: <zhengbin13@huawei.com>
Subject: [PATCH] fanotify: remove always false comparison in copy_fid_to_user
Date: Tue, 3 Sep 2019 09:54:14 +0800	[thread overview]
Message-ID: <1567475654-6133-1-git-send-email-zhengbin13@huawei.com> (raw)

Fixes gcc warning:

fs/notify/fanotify/fanotify_user.c:252:19: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]

Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: zhengbin <zhengbin13@huawei.com>
---
 fs/notify/fanotify/fanotify_user.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
index 8508ab5..e15547d 100644
--- a/fs/notify/fanotify/fanotify_user.c
+++ b/fs/notify/fanotify/fanotify_user.c
@@ -249,7 +249,7 @@ static int copy_fid_to_user(struct fanotify_event *event, char __user *buf)
 	/* Pad with 0's */
 	buf += fh_len;
 	len -= fh_len;
-	WARN_ON_ONCE(len < 0 || len >= FANOTIFY_EVENT_ALIGN);
+	WARN_ON_ONCE(len >= FANOTIFY_EVENT_ALIGN);
 	if (len > 0 && clear_user(buf, len))
 		return -EFAULT;

--
2.7.4


             reply	other threads:[~2019-09-03  1:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-03  1:54 zhengbin [this message]
2019-09-03 11:28 ` [PATCH] fanotify: remove always false comparison in copy_fid_to_user Matthew Wilcox
2019-09-03 20:10   ` Jan Kara
2019-09-03 11:40 ` Jan Kara

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1567475654-6133-1-git-send-email-zhengbin13@huawei.com \
    --to=zhengbin13@huawei.com \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).