* [PATCH] 2.5.62: /proc/ide/sis returns incomplete data [15/17]
@ 2003-02-22 23:39 Faik Uygur
0 siblings, 0 replies; only message in thread
From: Faik Uygur @ 2003-02-22 23:39 UTC (permalink / raw)
To: Lionel.Bouton; +Cc: linux-kernel
This patch fixes the incomplete data return problem of /proc/ide/sis.
When the number of consecutive read bytes are smaller than the total
data in sis_get_info(), the second read() returns 0.
--- linux-2.5.62-vanilla/drivers/ide/pci/sis5513.c Sun Feb 23 01:38:02 2003
+++ linux-2.5.62/drivers/ide/pci/sis5513.c Sun Feb 23 01:36:58 2003
@@ -396,6 +396,7 @@
static int sis_get_info (char *buffer, char **addr, off_t offset, int count)
{
char *p = buffer;
+ int len;
u8 reg;
u16 reg2, reg3;
@@ -466,7 +467,10 @@
p = get_masters_info(p);
p = get_slaves_info(p);
- return p-buffer;
+ len = (p - buffer) - offset;
+ *addr = buffer + offset;
+
+ return len > count ? count : len;
}
#endif /* defined(DISPLAY_SIS_TIMINGS) && defined(CONFIG_PROC_FS) */
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2003-02-22 23:29 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-22 23:39 [PATCH] 2.5.62: /proc/ide/sis returns incomplete data [15/17] Faik Uygur
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®