All of
 help / color / mirror / Atom feed
From: Jan Kara <>
To: Al Viro <>
	Andrew Morton <>,
	Jan Kara <>
Subject: [PATCH] seq_file: Remove pointless assignment in seq_read()
Date: Wed, 21 Jan 2015 13:46:52 +0100	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

The value assigned to 'err' in seq_read() is overwritten by the result
of copy_to_user(). This is correct because we know we have succeeded to
generate at least one entry into user buffer so the error we got when
generating further entries is irrelevant. Just remove the assignment.

Coverity-id: 1226981
Signed-off-by: Jan Kara <>
 fs/seq_file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/fs/seq_file.c b/fs/seq_file.c
index dbf3a59c86bb..548f78308e2a 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -255,10 +255,8 @@ Fill:
 		size_t offs = m->count;
 		loff_t next = pos;
 		p = m->op->next(m, p, &next);
-		if (!p || IS_ERR(p)) {
-			err = PTR_ERR(p);
+		if (!p || IS_ERR(p))
-		}
 		err = m->op->show(m, p);
 		if (seq_has_overflowed(m) || err) {
 			m->count = offs;

  reply	other threads:[~2015-01-21 12:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21 12:46 [PATCH] fs: Check return value of ->show_devname Jan Kara
2015-01-21 12:46 ` Jan Kara [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-10-21 15:12 [PATCH] seq_file: Remove pointless assignment in seq_read() 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:

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

  git send-email \ \ \ \ \ \

* 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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.