lkml.org 
[lkml]   [2003]   [Feb]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH] 2.5.62: /proc/ide/sis returns incomplete data [15/17]
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) */
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:0.025 / U:2.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site