From: Jerome Glisse Date: Thu, 12 Jul 2012 22:23:05 +0000 (-0400) Subject: drm/radeon: fix bo creation retry path X-Git-Tag: v3.2.25~7 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=12342624d45832c39cd6fc4ad2cc00c17d9d3854;p=karo-tx-linux.git drm/radeon: fix bo creation retry path commit d1c7871ddb1f588b8eb35affd9ee1a3d5e11cd0c upstream. Retry label was at wrong place in function leading to memory leak. Signed-off-by: Jerome Glisse Reviewed-by: Michel Dänzer Reviewed-by: Christian König Signed-off-by: Dave Airlie [bwh: Backported to 3.2: adjust context] Signed-off-by: Ben Hutchings --- diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index f3ae60759c5f..39497c76d476 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -117,7 +117,6 @@ int radeon_bo_create(struct radeon_device *rdev, return -ENOMEM; } -retry: bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); if (bo == NULL) return -ENOMEM; @@ -130,6 +129,8 @@ retry: bo->gem_base.driver_private = NULL; bo->surface_reg = -1; INIT_LIST_HEAD(&bo->list); + +retry: radeon_ttm_placement_from_domain(bo, domain); /* Kernel allocation are uninterruptible */ mutex_lock(&rdev->vram_mutex);