util/cbmem: Fix CBMEM TOC printing

Since commit c0199078 (cbmem utility: Find actual CBMEM area) [1], at least on
the Lenovo X201, X230 and X60, printing the CBMEM table of contents did
not work.  It still worked on the ASRock E350M1 though.

	$ sudo /src/coreboot/util/cbmem/cbmem -l --verbose # Lenovo X60t
	Looking for coreboot table at 0
	Mapping 1MB of physical memory at 0x0.
	Found!
	  coreboot table entry 0x11
	    Found forwarding entry.
	Unmapping 1MB of virtual memory at 0xb74dc000.
	Looking for coreboot table at 7f6c4000
	Mapping 1MB of physical memory at 0x7f6c4000.
	Found!
	  coreboot table entry 0xc8
	  coreboot table entry 0x01
	    Found memory map.
	  coreboot table entry 0x03
	  coreboot table entry 0x04
	  coreboot table entry 0x05
	  coreboot table entry 0x06
	  coreboot table entry 0x07
	  coreboot table entry 0x08
	  coreboot table entry 0x09
	  coreboot table entry 0x0a
	  coreboot table entry 0x16
	    Found timestamp table.
	      cbmem_addr = 7f7dd000
	  coreboot table entry 0x17
	    Found cbmem console.
	      cbmem_addr = 7f7de000
	Unmapping 1MB of virtual memory at 0xb74dc000.
	No coreboot CBMEM area found!

The address of the boot info record has to be used for checking, that reading
takes place in the bounds of the boot info record.

	$ sudo ~/src/coreboot/util/cbmem/cbmem -l # Lenovo X60
	CBMEM table of contents:
	    ID           START      LENGTH
	[…]

Big thanks to David and Stefan for their help.

[1] http://review.coreboot.org/2117

Change-Id: I1eb09a6445d9ea17e1e16b6866dece74315d3c73
Found-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-on: http://review.coreboot.org/7093
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
Reviewed-by: Patrick Georgi <pgeorgi@google.com>
diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index 3a5a428..f1de620 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -220,7 +220,7 @@
 				debug("    Found memory map.\n");
 				struct lb_memory *memory =
 						(struct lb_memory *)lbr_p;
-				while ((char *)&memory->map[i] < ((char *)lbtable
+				while ((char *)&memory->map[i] < ((char *)lbr_p
 							    + lbr_p->size)) {
 					if (memory->map[i].type == LB_MEM_TABLE) {
 						debug("      LB_MEM_TABLE found.\n");