summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_bios.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-08-04 05:57:33 +0200
committerBen Skeggs <bskeggs@redhat.com>2011-09-20 08:10:12 +0200
commita8e415d3eb1bed184d73e22c62cd1f992bd33d63 (patch)
tree54d51e7e0e82b36f9614f7d15a2d13c6f19a2859 /drivers/gpu/drm/nouveau/nouveau_bios.c
parentdrm/nva3/backlight: add suppport for newer style backlight regs (diff)
downloadlinux-a8e415d3eb1bed184d73e22c62cd1f992bd33d63.tar.xz
linux-a8e415d3eb1bed184d73e22c62cd1f992bd33d63.zip
drm/nouveau/bios: check for null script pointers in parser
Allows us to be lazy elsewhere... Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bios.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bios.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bios.c b/drivers/gpu/drm/nouveau/nouveau_bios.c
index 58d8c85b85d1..528fb6087814 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bios.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bios.c
@@ -3771,6 +3771,10 @@ parse_init_table(struct nvbios *bios, uint16_t offset, struct init_exec *iexec)
int count = 0, i, ret;
uint8_t id;
+ /* catch NULL script pointers */
+ if (offset == 0)
+ return 0;
+
/*
* Loop until INIT_DONE causes us to break out of the loop
* (or until offset > bios length just in case... )