From: Michel Dänzer Date: Fri, 22 Jan 2010 08:20:00 +0000 (+0100) Subject: drm/radeon/kms: Fix oops after radeon_cs_parser_init() failure. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=17aafccab4352b422aa01fa6ebf82daff693a5b3;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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 Signed-off-by: Dave Airlie --- 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 {