seq_file: Remove pointless assignment in seq_read()
diff mbox

Message ID 1421844412-15398-2-git-send-email-jack@suse.cz
State New, archived
Headers show

Commit Message

Jan Kara Jan. 21, 2015, 12:46 p.m. UTC
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 <jack@suse.cz>
---
 fs/seq_file.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Patch
diff mbox

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))
 			break;
-		}
 		err = m->op->show(m, p);
 		if (seq_has_overflowed(m) || err) {
 			m->count = offs;