[OpenBIOS] [PATCH 2/3] Improve getprop mem dump

Andreas Färber andreas.faerber at web.de
Fri Oct 8 15:49:04 CEST 2010


Currently the whole buffer supplied by the client is traced.
AIX uses buffer sizes such as 64, 256, 1024 on properties that might
not exist or contain 1 or 8 bytes.

Limit the output to the amount of data actually written into the buffer.

Signed-off-by: Andreas Färber <andreas.faerber at web.de>
---
 libopenbios/client.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/libopenbios/client.c b/libopenbios/client.c
index 2b78dcc..a93d8a3 100644
--- a/libopenbios/client.c
+++ b/libopenbios/client.c
@@ -171,7 +171,8 @@ static void dump_return(prom_args_t *pb)
 		printk("0x%08lx\n", pb->args[pb->nargs]);
 	} else if (strcmp(pb->service, "getprop") == 0) {
 		printk("%ld\n", pb->args[pb->nargs]);
-		memdump((char*)pb->args[2], pb->args[3]);
+		if ((long)pb->args[pb->nargs] != -1)
+			memdump((char*)pb->args[2], MIN(pb->args[3], pb->args[pb->nargs]));
 	} else if (strcmp(pb->service, "nextprop") == 0) {
 		printk("%ld\n", pb->args[pb->nargs]);
 		memdump((char*)pb->args[2], pb->args[pb->nargs]);
-- 
1.7.3




More information about the OpenBIOS mailing list