From patchwork Thu Oct 8 13:58:01 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Sudip Mukherjee X-Patchwork-Id: 7353011 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AA7299F1B9 for ; Thu, 8 Oct 2015 13:58:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1673207FE for ; Thu, 8 Oct 2015 13:58:22 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 10429207FF for ; Thu, 8 Oct 2015 13:58:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 42A9F6ECE6; Thu, 8 Oct 2015 06:58:18 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC1786ECE6 for ; Thu, 8 Oct 2015 06:58:16 -0700 (PDT) Received: by pabve7 with SMTP id ve7so15150732pab.2 for ; Thu, 08 Oct 2015 06:58:16 -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:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=X2euAhTEw7YNNlEWFURdRiH6wX/ejABrcKN5n+qPicE=; b=lZ2R7ZRhPZe+zSVBTsq8xs8CJKbGCX6TV7gakGIoxrTO2Y+udns0+WEi9lovc928Z6 kAoP7BYmgae1Ph/VrDNNkOIQ4NfwHQ7W/8lA8nL8itKeM3X9DNOGAHvQEvlNj+Dd1mBX Gabs7YjCvzQMNelQOKnmbzEvoK/EXYyswlRl6Yzd0kw2WNlXGiQIIL3eF80HFsNIMzxq pLRU6wkcOnbDFzwriEzMeF5daj472iAdE90qZAfIDMTBxHMwZsJazSO1K50xUoxMBLX8 ArL7MpeNi+owASPW8wneMAeU5OZjutQz9WCKbnMBhx0O7JTZPRkHyosOsUhR7nrd1i51 tP3Q== X-Received: by 10.69.1.5 with SMTP id bc5mr8251799pbd.151.1444312696553; Thu, 08 Oct 2015 06:58:16 -0700 (PDT) Received: from localhost.localdomain ([49.206.251.3]) by smtp.gmail.com with ESMTPSA id qp5sm45740820pbc.43.2015.10.08.06.58.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 08 Oct 2015 06:58:15 -0700 (PDT) From: Sudip Mukherjee To: David Airlie , Daniel Vetter Subject: [PATCH RESEND 3/3] drm/amdgpu: fix memory leak Date: Thu, 8 Oct 2015 19:28:01 +0530 Message-Id: <1444312681-10149-3-git-send-email-sudipm.mukherjee@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444312681-10149-1-git-send-email-sudipm.mukherjee@gmail.com> References: <1444312681-10149-1-git-send-email-sudipm.mukherjee@gmail.com> MIME-Version: 1.0 Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Sudip Mukherjee , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "monk.liu" X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If amdgpu_ib_get() fails we returned the error code but we missed freeing ib. Cc: "Christian König" Cc: Jammy Zhou Cc: Chunming Zhou Cc: Alex Deucher Cc: "monk.liu" Signed-off-by: Sudip Mukherjee --- Sent on 18/09/2015 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 1e14531..53d551f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -455,8 +455,10 @@ int amdgpu_vm_update_page_directory(struct amdgpu_device *adev, return -ENOMEM; r = amdgpu_ib_get(ring, NULL, ndw * 4, ib); - if (r) + if (r) { + kfree(ib); return r; + } ib->length_dw = 0; /* walk over the address space and update the page directory */