summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2010-01-22 09:20:00 +0100
committerDave Airlie <airlied@redhat.com>2010-02-01 03:49:28 +0100
commit17aafccab4352b422aa01fa6ebf82daff693a5b3 (patch)
treecee643823053ccdaad63ee84e1c0a9e43f233ca0 /drivers/gpu
parentdrm/radeon/kms: move radeon KMS on/off switch out of staging. (diff)
downloadlinux-17aafccab4352b422aa01fa6ebf82daff693a5b3.tar.xz
linux-17aafccab4352b422aa01fa6ebf82daff693a5b3.zip
drm/radeon/kms: Fix oops after radeon_cs_parser_init() failure.
If radeon_cs_parser_init() fails, radeon_cs_ioctl() calls radeon_cs_parser_fini() with the non-zero error value. The latter dereferenced parser->ib which hasn't been initialized yet -> boom. Add a test for parser->ib being non-NULL before dereferencing it. Signed-off-by: Michel Dänzer <daenzer@vmware.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/radeon/radeon_cs.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c
index 1496cb8658ef..1190148cf5e6 100644
--- a/drivers/gpu/drm/radeon/radeon_cs.c
+++ b/drivers/gpu/drm/radeon/radeon_cs.c
@@ -189,7 +189,7 @@ static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error)
{
unsigned i;
- if (error) {
+ if (error && parser->ib) {
radeon_bo_list_unvalidate(&parser->validated,
parser->ib->fence);
} else {