[PATCH] seq_file: Remove pointless assignment in seq_read()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxx>
---
 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 3857b720cb1b..cf53252e4784 100644
--- a/fs/seq_file.c
+++ b/fs/seq_file.c
@@ -262,10 +262,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_overflow(m) || err) {
 			m->count = offs;
-- 
1.8.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux