From patchwork Sat Sep 24 20:07:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 9350081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BA5D8607F0 for ; Mon, 26 Sep 2016 01:02:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AC85F28C63 for ; Mon, 26 Sep 2016 01:02:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9F73B28C6A; Mon, 26 Sep 2016 01:02:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 44D6A28C63 for ; Mon, 26 Sep 2016 01:02:57 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 206B96E2F5; Mon, 26 Sep 2016 01:02:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp.smtpout.orange.fr (smtp04.smtpout.orange.fr [80.12.242.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id AC5236E103 for ; Sat, 24 Sep 2016 20:07:38 +0000 (UTC) Received: from localhost.localdomain ([92.140.231.207]) by mwinf5d59 with ME id nY7Z1t00E4V8R7g03Y7a5C; Sat, 24 Sep 2016 22:07:36 +0200 X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sat, 24 Sep 2016 22:07:36 +0200 X-ME-IP: 92.140.231.207 From: Christophe JAILLET To: thierry.reding@gmail.com, airlied@linux.ie, swarren@wwwdotorg.org, gnurou@gmail.com, linux-tegra@vger.kernel.org Subject: [PATCH] drm/tegra: sor: No need to free devm_ allocated memory Date: Sat, 24 Sep 2016 22:07:30 +0200 Message-Id: <1474747650-10306-1-git-send-email-christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.7.4 X-Antivirus: avast! (VPS 160924-1, 24/09/2016), Outbound message X-Antivirus-Status: Clean X-Mailman-Approved-At: Mon, 26 Sep 2016 01:01:51 +0000 Cc: Christophe JAILLET , kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 'brick' has been allocated by 'devm_kzalloc', so there is no need here to free it explicitly. There is only one caller of 'tegra_clk_sor_brick_register()'. This function is a probe function which correctly checks and handles the return value of 'tegra_clk_sor_brick_register()'. Signed-off-by: Christophe JAILLET --- drivers/gpu/drm/tegra/sor.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/tegra/sor.c b/drivers/gpu/drm/tegra/sor.c index 74d0540b8d4c..a8f528925009 100644 --- a/drivers/gpu/drm/tegra/sor.c +++ b/drivers/gpu/drm/tegra/sor.c @@ -349,8 +349,6 @@ static struct clk *tegra_clk_sor_brick_register(struct tegra_sor *sor, brick->hw.init = &init; clk = devm_clk_register(sor->dev, &brick->hw); - if (IS_ERR(clk)) - kfree(brick); return clk; }