From patchwork Wed Sep 4 06:28:10 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 19740 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qc0-f197.google.com (mail-qc0-f197.google.com [209.85.216.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7212725DFC for ; Wed, 4 Sep 2013 06:28:34 +0000 (UTC) Received: by mail-qc0-f197.google.com with SMTP id l13sf7307072qcy.0 for ; Tue, 03 Sep 2013 23:28:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=7ptslblbTUSB7sG0z3mfCt+tF73hRUszpKjbxVYEYho=; b=dO83JKGmzi2EUfayD+9Pt5x5gpsQw2Ac765/h9dhP3/Chj8K7DEgptlK18W72LvgdF QZ8XpbreL2itH2aphxWW0hEjFPrIt40rAvUAAKW/y5mFDX3RqZ9YL8C5xYAuFA0iQgpN haKnQqf27ZURqkZ96tlXTpVTkEoZYww7LGp9dI+soTsVlGbls3JKEWqFYs0b9qJpaxht kr4li4gB8wYc3hhKkjSRZKEvYbR4or+n1+no3r7+GrauLspiaSoNpYXtdsqq5Ar0sNBz hSqWYP/GHfR/C+t3N6j7YO3HKzO8x53hO5EGoj0clfW1QAxGoSkwRt2WaZnChlC5GQZr KwuA== X-Received: by 10.236.51.9 with SMTP id a9mr464348yhc.41.1378276113928; Tue, 03 Sep 2013 23:28:33 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.81.178 with SMTP id b18ls178qey.37.gmail; Tue, 03 Sep 2013 23:28:33 -0700 (PDT) X-Received: by 10.58.106.82 with SMTP id gs18mr1097179veb.18.1378276113797; Tue, 03 Sep 2013 23:28:33 -0700 (PDT) Received: from mail-vb0-f49.google.com (mail-vb0-f49.google.com [209.85.212.49]) by mx.google.com with ESMTPS id ee8si2709163vdc.80.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 23:28:33 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.212.49; Received: by mail-vb0-f49.google.com with SMTP id w16so4588629vbb.36 for ; Tue, 03 Sep 2013 23:28:33 -0700 (PDT) X-Gm-Message-State: ALoCoQnI8I11wIrfaVlONaivJcr6A4AWFuqbPkRbdtB/uh+X955hDmKts9YBXCZRSm6hnR1Ct79Q X-Received: by 10.220.46.72 with SMTP id i8mr1120889vcf.10.1378276113524; Tue, 03 Sep 2013 23:28:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp216939vcz; Tue, 3 Sep 2013 23:28:32 -0700 (PDT) X-Received: by 10.68.194.104 with SMTP id hv8mr1410550pbc.168.1378276112381; Tue, 03 Sep 2013 23:28:32 -0700 (PDT) Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by mx.google.com with ESMTPS id uh5si18570868pab.296.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 23:28:32 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.177 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.177; Received: by mail-pd0-f177.google.com with SMTP id y10so7008735pdj.22 for ; Tue, 03 Sep 2013 23:28:30 -0700 (PDT) X-Received: by 10.68.211.233 with SMTP id nf9mr1573756pbc.26.1378276108853; Tue, 03 Sep 2013 23:28:28 -0700 (PDT) Received: from manjunath-Latitude-E6420.LGE.NET ([203.247.149.152]) by mx.google.com with ESMTPSA id oc10sm26827594pbb.3.1969.12.31.16.00.00 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 03 Sep 2013 23:28:28 -0700 (PDT) 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 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: manjunath.goudar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.49 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , 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 Reviewed-by: Konrad Rzeszutek Wilk --- 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; }