All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] small time list process error in prom_getenv()
@ 2006-03-27  7:43 Freddy Spierenburg
  2006-03-27  8:32 ` Sergei Shtylylov
  0 siblings, 1 reply; 8+ messages in thread
From: Freddy Spierenburg @ 2006-03-27  7:43 UTC (permalink / raw)
  To: linux-mips


[-- Attachment #1.1: Type: text/plain, Size: 817 bytes --]

Hi,

I found a small time bug in prom_getenv() for which I like to
share the fix with y'all.

prom_envp is an array with two elements per environment variable.
So for instance element 0 is memsize and element 1 is 0x08000000
for the environment variable memsize=0x08000000.

The code for prom_getenv() only skips one element when it's in
search for the next environment variable. It should of course
step two elements.

I found this error in two files and for both I include a patch to
fix the problem.

Signed-off-by: Freddy Spierenburg <freddy@dusktilldawn.nl>

-- 
$ cat ~/.signature
Freddy Spierenburg <freddy@dusktilldawn.nl>  http://freddy.snarl.nl/
GnuPG: 0x7941D1E1=C948 5851 26D2 FA5C 39F1  E588 6F17 FD5D 7941 D1E1
$ # Please read http://www.ietf.org/rfc/rfc2015.txt before complain!

[-- Attachment #1.2: prom.pnx8550.patch --]
[-- Type: text/plain, Size: 442 bytes --]

diff -Naur linux.orig/arch/mips/philips/pnx8550/common/prom.c linux/arch/mips/philips/pnx8550/common/prom.c
--- linux.orig/arch/mips/philips/pnx8550/common/prom.c	2006-03-22 15:25:58.000000000 +0000
+++ linux/arch/mips/philips/pnx8550/common/prom.c	2006-03-22 15:25:23.000000000 +0000
@@ -70,7 +70,7 @@
 		if(strncmp(envname, env->name, i) == 0) {
 			return(env->name + strlen(envname) + 1);
 		}
-		env++;
+		env+=2;
 	}
 	return(NULL);
 }

[-- Attachment #1.3: prom.au1000.patch --]
[-- Type: text/plain, Size: 406 bytes --]

diff -Naur linux.orig/arch/mips/au1000/common/prom.c linux/arch/mips/au1000/common/prom.c
--- linux.orig/arch/mips/au1000/common/prom.c	2006-03-22 15:11:09.000000000 +0000
+++ linux/arch/mips/au1000/common/prom.c	2006-03-22 15:16:22.000000000 +0000
@@ -97,7 +97,7 @@
 		if(strncmp(envname, env->name, i) == 0) {
 			return(env->name + strlen(envname) + 1);
 		}
-		env++;
+		env+=2;
 	}
 	return(NULL);
 }

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 191 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-31 21:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-27  7:43 [PATCH] small time list process error in prom_getenv() Freddy Spierenburg
2006-03-27  8:32 ` Sergei Shtylylov
2006-03-27 18:44   ` [PATCH] Au1xx0: fix prom_getenv() to handle YAMON style environment Sergei Shtylylov
2006-03-28 14:54   ` [PATCH] rtc.h: fixes to make genrtc.c compilable Ralf Rösch
2006-03-28 15:12   ` Ralf Rösch
2006-03-28 15:14     ` Sergei Shtylylov
2006-03-30 15:02   ` [PATCH] small time list process error in prom_getenv() Sergei Shtylyov
2006-03-31 21:20   ` [PATCH] Au1550: make OSS drivers look pretty on loading Sergei Shtylyov

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.