From patchwork Wed Jul 13 18:00:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 9228333 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 C696B60572 for ; Wed, 13 Jul 2016 18:00:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC65927F4B for ; Wed, 13 Jul 2016 18:00:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0F1C27F94; Wed, 13 Jul 2016 18:00:36 +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, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5BEF27F4B for ; Wed, 13 Jul 2016 18:00:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B77D86E2C8; Wed, 13 Jul 2016 18:00:31 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mout.web.de (mout.web.de [212.227.15.3]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8D0686E2C8 for ; Wed, 13 Jul 2016 18:00:29 +0000 (UTC) Received: from [192.168.1.2] ([78.53.182.169]) by smtp.web.de (mrweb003) with ESMTPSA (Nemesis) id 0Le4PE-1b2QAN2Zsi-00prq2; Wed, 13 Jul 2016 20:00:23 +0200 Subject: [PATCH 1/3] drm/msm/hdmi: Delete an unnecessary check before the function call "kfree" To: David Airlie , Rob Clark , dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org References: <5307CAA2.8060406@users.sourceforge.net> <530A086E.8010901@users.sourceforge.net> <530A72AA.3000601@users.sourceforge.net> <530B5FB6.6010207@users.sourceforge.net> <530C5E18.1020800@users.sourceforge.net> <530CD2C4.4050903@users.sourceforge.net> <530CF8FF.8080600@users.sourceforge.net> <530DD06F.4090703@users.sourceforge.net> <5317A59D.4@users.sourceforge.net> <351a1279-b0ca-5f5e-d175-28c9de8406f6@users.sourceforge.net> From: SF Markus Elfring Message-ID: Date: Wed, 13 Jul 2016 20:00:11 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2 MIME-Version: 1.0 In-Reply-To: <351a1279-b0ca-5f5e-d175-28c9de8406f6@users.sourceforge.net> X-Provags-ID: V03:K0:ldMyi2PxQQ+OHk0qYqFliuxfjsadULBP+C/APvttMQMS0HJonO+ zEUdv5rlQ8c4DmMqLYgqSCTzxhtRBfRP7Bs/AEbHTnGe0WzTnBd8rCsWO6zt/SDofK7O86M zjf5uyxuzZJ/eES/Vz8VJT8VOlYzgA3DOnAYzucRCmJUQJn4nIHGrt0TGrSXftcbZnINM7J Z/L0lso5CgoRp6Dg9c0MQ== X-UI-Out-Filterresults: notjunk:1; V01:K0:kW+xcPVdM/A=:Zgi8rpPYvtJ6wgEpaY2/dz xCU8q/zXn9h3/swZ8BBOxyyPAx/aySGGt8Xb5eVl/zQlNgmTT5wbNeGPPdUcfbtqkVqKKRlI3 CkzOs9VAoEyMl+hLR/GhbzfPHrw2BBhrg26DhYZVZOnFtr+cPWEymklL/NPoUXLWoJQn7H0vJ JsqFXmLenpLSSqWIGcp67SOgDulmn+gMCeSCJ2E4tfscc4klhkWBZOoZikCc64xqhPNGaMScQ VUxp6aL+/f8/D6Pqqk8wicKsnvncUwy5bMP2p/7IPwTxFwJZ61m54hycdRbJREx8PIDMkitlC OaslFRtXNE9vdo1RNc6rzjPHp/4kFoi2ovBWj955YfUlqwAg3V8c5LJDiKWaot4TPpa0ifD7m AnxA/PCwmuPyICk+4CihCa8mLKM6So39yuzG7kvNj8DTO6XVk6upk7e2jxv77sWZEdZF3JRZC 8UAj3nvlrUXal32wgqx0Kk15K243NL/SaOlHMcPhrwT1WJODzexCFa0/1VhspI6hvUDoT/I8v vVyStve29k1sir+7i1Xeqkeu0CPtnirj+BjaLUkNqniuY98IJPATnZwvv4ZhZgk7H6fKizhX4 nmv3sOTea4TcSOUfIY9W2MheID7dF8CB5hHcfHAwV9r2q70Dpd5G8+UqMpIOev9B8vKxtNXIA MldUc7Z5b6QEG85N2OepHy1cHgqOrCcgSflh+Bfz0lh40LkqlbbnW7v/Jm5ZHMuR7rxeoVege g4TDZvGFw4kncs0qmk8Mg30DUYEo161ZTwcCVuXwfNbJtPC6YcJEg9CmTtAf6sAUjgw+jhyms i/3//oA Cc: Julia Lawall , kernel-janitors@vger.kernel.org, LKML 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-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Wed, 13 Jul 2016 18:54:11 +0200 The kfree() function tests whether its argument is NULL and then returns immediately. Thus the test around the call is not needed. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring --- drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c index 0baaaaa..6e76797 100644 --- a/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c +++ b/drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c @@ -1430,7 +1430,7 @@ struct hdmi_hdcp_ctrl *msm_hdmi_hdcp_init(struct hdmi *hdmi) void msm_hdmi_hdcp_destroy(struct hdmi *hdmi) { - if (hdmi && hdmi->hdcp_ctrl) { + if (hdmi) { kfree(hdmi->hdcp_ctrl); hdmi->hdcp_ctrl = NULL; }