From patchwork Thu Jul 12 22:23:05 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jerome Glisse X-Patchwork-Id: 1190891 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 59D2640B20 for ; Thu, 12 Jul 2012 22:26:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 038C4A0FD8 for ; Thu, 12 Jul 2012 15:26:11 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-yw0-f49.google.com (mail-yw0-f49.google.com [209.85.213.49]) by gabe.freedesktop.org (Postfix) with ESMTP id 245689E75A for ; Thu, 12 Jul 2012 15:26:01 -0700 (PDT) Received: by yhjj52 with SMTP id j52so3148856yhj.36 for ; Thu, 12 Jul 2012 15:26:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer; bh=CzkMJPc4Hk0ATZOCnaU47JmPcD89/f8bGRYAK6BqjbQ=; b=NH03xMM8RWCYP3QnQ1I7mEcYG/IXGr3GNEjMeOONpVov9ODjZSEkWy4NNQW3oUbBwX 0siPy0kS0z2OCqPvyu/aRh5RMVRzw2aUB3hbL1HDUHnGPI5Dv62fhrUfpkx8i8y0iqv5 c1ma6TQChA/kA87qEkBpbD1nDIBt4Bry1LvjMemz6lXY7v1KNOE3yAsg2AYVe8Ip9UTS lOMl4v2vjA1rAX2t92r76QrgmkhJFEKFPOiqcgWonVDhAjX26TJBo/UIUJXm4PewBPd/ JuzNbGlhZyMwnst1omJe+G4/vSEWCflRQDqEF54Oo/lWyh3lL7LK20cybYf2i53Pg+rk BLKQ== Received: by 10.236.197.42 with SMTP id s30mr3410yhn.64.1342131960690; Thu, 12 Jul 2012 15:26:00 -0700 (PDT) Received: from localhost.boston.devel.redhat.com ([66.187.233.206]) by mx.google.com with ESMTPS id l13sm5838431ann.2.2012.07.12.15.25.59 (version=SSLv3 cipher=OTHER); Thu, 12 Jul 2012 15:25:59 -0700 (PDT) From: j.glisse@gmail.com To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/radeon: fix bo creation retry path Date: Thu, 12 Jul 2012 18:23:05 -0400 Message-Id: <1342131785-12373-1-git-send-email-j.glisse@gmail.com> X-Mailer: git-send-email 1.7.10.4 Cc: Jerome Glisse , stable@vger.kernel.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Jerome Glisse Retry label was at wrong place in function leading to memory leak. Cc: Signed-off-by: Jerome Glisse Reviewed-by: Michel Dänzer Reviewed-by: Christian König --- drivers/gpu/drm/radeon/radeon_object.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/radeon/radeon_object.c b/drivers/gpu/drm/radeon/radeon_object.c index 6ecb200..f71e472 100644 --- a/drivers/gpu/drm/radeon/radeon_object.c +++ b/drivers/gpu/drm/radeon/radeon_object.c @@ -138,7 +138,6 @@ int radeon_bo_create(struct radeon_device *rdev, acc_size = ttm_bo_dma_acc_size(&rdev->mman.bdev, size, sizeof(struct radeon_bo)); -retry: bo = kzalloc(sizeof(struct radeon_bo), GFP_KERNEL); if (bo == NULL) return -ENOMEM; @@ -152,6 +151,8 @@ retry: bo->surface_reg = -1; INIT_LIST_HEAD(&bo->list); INIT_LIST_HEAD(&bo->va); + +retry: radeon_ttm_placement_from_domain(bo, domain); /* Kernel allocation are uninterruptible */ down_read(&rdev->pm.mclk_lock);