Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762011Ab3IDG2d (ORCPT ); Wed, 4 Sep 2013 02:28:33 -0400 Received: from mail-pb0-f48.google.com ([209.85.160.48]:60555 "EHLO mail-pb0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756397Ab3IDG2b (ORCPT ); Wed, 4 Sep 2013 02:28:31 -0400 From: Manjunath Goudar To: patches@linaro.org Cc: linaro-kernel@lists.linaro.org, dsaxena@linaro.org, Jeyaraman R , Manjunath Goudar , David Airlie , "Paul E. McKenney" , David Howells , Thomas Gleixner , Dave Jones , Dave Airlie , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH] DRM: TTM: Fix memory leak issue in ttm_agp_tt_create(). Date: Wed, 4 Sep 2013 11:58:10 +0530 Message-Id: <1378276090-10130-1-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1411 Lines: 40 From: Jeyaraman R This patch adds kfree() in ttm_agp_tt_create() to avoide the memory leak, without this there is a chance of memory leak in ttm_tt_init() fail case. Signed-off-by: Jeyaraman R Signed-off-by: Manjunath Goudar Cc: David Airlie Cc: "Paul E. McKenney" Cc: David Howells Cc: Thomas Gleixner Cc: Dave Jones Cc: Dave Airlie Cc: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org --- drivers/gpu/drm/ttm/ttm_agp_backend.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index 3302f99..764be36 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -126,6 +126,7 @@ struct ttm_tt *ttm_agp_tt_create(struct ttm_bo_device *bdev, agp_be->ttm.func = &ttm_agp_func; if (ttm_tt_init(&agp_be->ttm, bdev, size, page_flags, dummy_read_page)) { + kfree(agp_be); return NULL; } -- 1.8.1.2 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/