From: Geert Uytterhoeven <geert@linux-m68k.org>
Date: Wed, 9 Jun 2010 09:24:32 +0000 (+0200)
Subject: zorro: Fix reading of proc/bus/zorro/* in small chunks
X-Git-Tag: firefly_0821_release~9833^2~1030^2
X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2190a1e7705456c2298873b2547a6eb19b8e31ae;p=firefly-linux-kernel-4.4.55.git

zorro: Fix reading of proc/bus/zorro/* in small chunks

proc_bus_zorro_read() didn't take into account the current file position,
hence it always read from the start of the ConfigDev.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
---

diff --git a/drivers/zorro/proc.c b/drivers/zorro/proc.c
index 4f4ea88fbb71..cafc50454292 100644
--- a/drivers/zorro/proc.c
+++ b/drivers/zorro/proc.c
@@ -68,7 +68,7 @@ proc_bus_zorro_read(struct file *file, char __user *buf, size_t nbytes, loff_t *
 	cd.cd_BoardAddr = (void *)zorro_resource_start(z);
 	cd.cd_BoardSize = zorro_resource_len(z);
 
-	if (copy_to_user(buf, &cd, nbytes))
+	if (copy_to_user(buf, (void *)&cd + pos, nbytes))
 		return -EFAULT;
 	*ppos += nbytes;