From: Christian König Date: Wed, 21 May 2014 15:43:59 +0000 (+0200) Subject: drm/radeon: avoid crash if VM command submission isn't available X-Git-Tag: v3.14.7~41 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=3f7134a93ee1298e2430889b77898786c0cc31eb;p=unionfs-2.6.36.y.git drm/radeon: avoid crash if VM command submission isn't available commit 60a445405a1731bac2279eab354173c9c3156747 upstream. Signed-off-by: Christian König Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index dfb5a1db87d..7993aec86ac 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c @@ -276,10 +276,17 @@ int radeon_cs_parser_init(struct radeon_cs_parser *p, void *data) return -EINVAL; /* we only support VM on some SI+ rings */ - if ((p->rdev->asic->ring[p->ring]->cs_parse == NULL) && - ((p->cs_flags & RADEON_CS_USE_VM) == 0)) { - DRM_ERROR("Ring %d requires VM!\n", p->ring); - return -EINVAL; + if ((p->cs_flags & RADEON_CS_USE_VM) == 0) { + if (p->rdev->asic->ring[p->ring]->cs_parse == NULL) { + DRM_ERROR("Ring %d requires VM!\n", p->ring); + return -EINVAL; + } + } else { + if (p->rdev->asic->ring[p->ring]->ib_parse == NULL) { + DRM_ERROR("VM not supported on ring %d!\n", + p->ring); + return -EINVAL; + } } }