From patchwork Thu Feb 27 14:41:37 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 3737561 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 1FC399F2ED for ; Fri, 28 Feb 2014 02:24:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 435872021F for ; Fri, 28 Feb 2014 02:24:25 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 2E5E9201FE for ; Fri, 28 Feb 2014 02:24:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5890DFBA02; Thu, 27 Feb 2014 18:24:14 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.gmx.net (mout.gmx.net [212.227.17.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 7A180FB784 for ; Thu, 27 Feb 2014 06:42:12 -0800 (PST) Received: from Workstation4.fritz.box ([109.91.85.119]) by mail.gmx.com (mrgmx101) with ESMTPSA (Nemesis) id 0MFxwA-1WUd1h0gy6-00ExrM for ; Thu, 27 Feb 2014 15:42:11 +0100 From: xypron.glpk@gmx.de To: airlied@linux.ie Subject: [PATCH] Memory leak in nouveau_sgdma_create_ttm Date: Thu, 27 Feb 2014 15:41:37 +0100 Message-Id: <1393512097-10597-1-git-send-email-xypron.glpk@gmx.de> X-Mailer: git-send-email 1.7.10.4 X-Provags-ID: V03:K0:oxHDFdPEDGB6S76VdtxEsTTZ/Vn8mqHFtu2UtUOGtnr49O5c2+N b/WOhyoQYnF0c1FLJQKppvYW0TRGHrO7YiodCsfkSWAoQAug7ag5roDkTUd0YYsJneutnHt e80+E1mG+fEOd/NhXBkhC9mskjBXdZ0LDMUEcV5hiYILOBKZrF8G/vjjwXmO2f4gxXXm8Vh AhAXdU3pV+LmxqgpBlXwA== X-Mailman-Approved-At: Thu, 27 Feb 2014 18:24:12 -0800 Cc: Heinrich Schuchardt , bskeggs@redhat.com, dri-devel@lists.freedesktop.org, linux-kernel@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@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, 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 From: Heinrich Schuchardt In case of failure memory was not freed. Signed-off-by: Heinrich Schuchardt --- drivers/gpu/drm/nouveau/nouveau_sgdma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_sgdma.c b/drivers/gpu/drm/nouveau/nouveau_sgdma.c index a4d22e5..23d880b 100644 --- a/drivers/gpu/drm/nouveau/nouveau_sgdma.c +++ b/drivers/gpu/drm/nouveau/nouveau_sgdma.c @@ -109,7 +109,9 @@ nouveau_sgdma_create_ttm(struct ttm_bo_device *bdev, else nvbe->ttm.ttm.func = &nv50_sgdma_backend; - if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) + if (ttm_dma_tt_init(&nvbe->ttm, bdev, size, page_flags, dummy_read_page)) { + kfree(nvbe); return NULL; + } return &nvbe->ttm.ttm; }