diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2011-08-03 23:57:33 -0400 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2011-09-20 02:10:12 -0400 |
commit | a8e415d3eb1bed184d73e22c62cd1f992bd33d63 (patch) | |
tree | 54d51e7e0e82b36f9614f7d15a2d13c6f19a2859 /drivers/gpu/drm | |
parent | 5024c54b5cc6e93a8e2713f53981423d0deb60d7 (diff) |
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')
-rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_bios.c | 4 |
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) | |||
3771 | int count = 0, i, ret; | 3771 | int count = 0, i, ret; |
3772 | uint8_t id; | 3772 | uint8_t id; |
3773 | 3773 | ||
3774 | /* catch NULL script pointers */ | ||
3775 | if (offset == 0) | ||
3776 | return 0; | ||
3777 | |||
3774 | /* | 3778 | /* |
3775 | * Loop until INIT_DONE causes us to break out of the loop | 3779 | * Loop until INIT_DONE causes us to break out of the loop |
3776 | * (or until offset > bios length just in case... ) | 3780 | * (or until offset > bios length just in case... ) |