From 55ba70c40661b61f98c4188c428f265009af1aa5 Mon Sep 17 00:00:00 2001 From: Dan Carpenter Date: Mon, 9 Jan 2012 15:44:50 +0300 Subject: [PATCH] drm/radeon: use after free in radeon_vm_bo_add() "bo_va" is dereferenced in the error message. Signed-off-by: Dan Carpenter Signed-off-by: Dave Airlie --- drivers/gpu/drm/radeon/radeon_gart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_gart.c b/drivers/gpu/drm/radeon/radeon_gart.c index 8597d2c016e6..a97baf5c114f 100644 --- a/drivers/gpu/drm/radeon/radeon_gart.c +++ b/drivers/gpu/drm/radeon/radeon_gart.c @@ -494,10 +494,10 @@ int radeon_vm_bo_add(struct radeon_device *rdev, } if (bo_va->soffset >= tmp->soffset && bo_va->soffset < tmp->eoffset) { /* bo and tmp overlap, invalid offset */ - kfree(bo_va); dev_err(rdev->dev, "bo %p va 0x%08X conflict with (bo %p 0x%08X 0x%08X)\n", bo, (unsigned)bo_va->soffset, tmp->bo, (unsigned)tmp->soffset, (unsigned)tmp->eoffset); + kfree(bo_va); mutex_unlock(&vm->mutex); return -EINVAL; } -- 2.20.1