Skip to contentSkip to conversation

2.5.62: /proc/ide/ali returns incomplete data [2/17]

PATCH New Faik Uygur 1 participant 1 message Feb 22, 2003

lore
Share & tools
lore

Faik Uygur

author
#0 lore raw

PATCH 1/1 2.5.62: /proc/ide/ali returns incomplete data [2/17]

This patch fixes the incomplete data return problem of /proc/ide/ali. When the number of consecutive read bytes are smaller than the total data in ali_get_info(), the second read() returns 0.

drivers/ide/pci/alim15x3.c +6 -1
@@ -96,6 +96,7 @@
 {
 	u32 bibma;
 	u8 reg53h, reg5xh, reg5yh, reg5xh1, reg5yh1, c0, c1, rev, tmp;
+	int len;
 	char *q, *p = buffer;
 
 	/* fetch rev. */
@@ -270,7 +271,11 @@
 		udmaT[reg5yh & 0x07],
 		udmaT[(reg5yh & 0x70) >> 4] );
 
-	return p-buffer; /* => must be less than 4k! */
+	/* p - buffer must be less than 4k! */
+	len = (p - buffer) - offset;
+	*addr = buffer + offset;
+	
+	return len > count ? count : len;
 }
 #endif  /* defined(DISPLAY_ALI_TIMINGS) && defined(CONFIG_PROC_FS) */