intel/i945: don't read structs out of uninitialized pointers

Change-Id: I7f17cd1418f05ff3e8cd559eca6ec3ce7f9bfb79
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Reviewed-on: http://review.coreboot.org/11139
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
diff --git a/src/northbridge/intel/i945/gma.c b/src/northbridge/intel/i945/gma.c
index a2e5163..437b6ce 100644
--- a/src/northbridge/intel/i945/gma.c
+++ b/src/northbridge/intel/i945/gma.c
@@ -496,6 +496,9 @@
 		return NULL;
 	}
 	struct northbridge_intel_i945_config *chip = dev->chip_info;
+	if (!chip) {
+		return NULL;
+	}
 	return &chip->gfx;
 }