drm/radeon/kms: Fix oops after radeon_cs_parser_init() failure.
authorMichel Dänzer <daenzer@vmware.com>
Fri, 22 Jan 2010 08:20:00 +0000 (09:20 +0100)
committerDave Airlie <airlied@redhat.com>
Mon, 1 Feb 2010 02:49:28 +0000 (12:49 +1000)
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>
drivers/gpu/drm/radeon/radeon_cs.c

index 1496cb8658ef283e79f52f4282e9a4acc2cde90e..1190148cf5e6aa1ea959933127ce2f396d81dc22 100644 (file)
@@ -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 {