From patchwork Fri Nov 6 14:05:43 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 7576201 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id E311DC05C6 for ; Sat, 7 Nov 2015 18:38:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 20D3920553 for ; Sat, 7 Nov 2015 18:38:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5472C20534 for ; Sat, 7 Nov 2015 18:38:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 314EC6E06D; Sat, 7 Nov 2015 10:38:14 -0800 (PST) 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.14]) by gabe.freedesktop.org (Postfix) with ESMTPS id C4C5489AB7 for ; Fri, 6 Nov 2015 06:05:50 -0800 (PST) Received: from [192.168.1.2] ([78.49.86.198]) by smtp.web.de (mrweb004) with ESMTPSA (Nemesis) id 0MOlTq-1Zpjpc1yTe-006ARM; Fri, 06 Nov 2015 15:05:46 +0100 Subject: [PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree" 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> To: David Airlie , dri-devel@lists.freedesktop.org From: SF Markus Elfring Message-ID: <563CB3B7.7010403@users.sourceforge.net> Date: Fri, 6 Nov 2015 15:05:43 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <5317A59D.4@users.sourceforge.net> X-Provags-ID: V03:K0:aDrqv5MQUXSYuC+5ZCDKNvmiPxT08dfiLEPnNxBOgNDbSy3E9sk vRXPzL6H6BumX5blLpmV9H+2U7VHmwgMypiGhrDMvHSwBCI4/5MgSp5g/inZWFXJVkohinD GM34ihpra0Zs8C6xX+JmwyvhPAZHd+hgW4WCFqB9MQhb9FvhWlyR6aSUSBZ3yao++jra/Xx /po0/t5VT4MPf6uqT7EqA== X-UI-Out-Filterresults: notjunk:1; V01:K0:gd9gqFpWD0Q=:NrN7FdcB4Pp6j07CJJTPQa WKZWvCTtvSzxlu/yyqppCu7iCdUipCzAK1EDLW1yc2MKF1RFwN+gjFkij0Mg8oBJNjwTSdfAx z3wQkzwzXf+gYcJY/nV9eMna7104eajhqO6GpC5/eAavkzlm+3+NkrXa31l1paS7qY6GWywDU uWRDCqmIGK3Jy+2t5l2YqH9dhVoNgi4g4UYbFXfsnc/7Csa6wOKiBJo3YVMpJzve1YUI0dYrd 9NTgFN1/q3BcdJxJwd2VsdGGqVoEftJsZOTfk9wEsnWKfUr5JQdfXFCltEfd41Fe0UiWFQuA1 UOIlGWloZIXYeyx06gxAMip+xhpQrKTTvLHF5l72bp/rKq8ha1eLNWNCqM3Fc9feMfZ0A+/h8 INGG4nKv+QDIYijtEO1xDLBMi6jZj7SbVVEwBRW+UZjKKuXc/UzUZLiXdr7DDguiofvw9PPxd PFs3IdG7d+nGtviIwnyXzNB369bV86cv9ojf2u9DxjaLeikPpzwyzXo5hl0Jm4Np5N3EdZPBW ZAjETUL3ZSLi+LW5cO1k7d9r6gjgg9+XTVeDY7lCvA+VD9FPkwO27bueqhRB5K0lHC/GTNRaM UbE6xAHjwy+iJjMplxtRi6+HO4FSCAQx4FsUwE9bDLHWed+XWLW4nU204Fx4ysZ9Mkb5yBjI1 hIUDgtBU+C1HKz2gTrWEJNWWKr5KhYAMCP5TH/+5BKNbCLj1ZzeP05LI/NA2mQYSFCcPS89Ze fF7kDyJ9D/Pqj52qSS0xJ/JJucrpPfNEbyYu8Pqgn1lcdCN3G3TcBzMbjg1rvp/0KKp7zZPVU ECmv4XS X-Mailman-Approved-At: Sat, 07 Nov 2015 10:38:13 -0800 Cc: Julia Lawall , kernel-janitors@vger.kernel.org, Linux Kernel Mailing List 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-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_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: Markus Elfring Date: Fri, 6 Nov 2015 15:00:22 +0100 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 1dc9c34..205e931 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 *hdmi_hdcp_init(struct hdmi *hdmi) void hdmi_hdcp_destroy(struct hdmi *hdmi) { - if (hdmi && hdmi->hdcp_ctrl) { + if (hdmi) { kfree(hdmi->hdcp_ctrl); hdmi->hdcp_ctrl = NULL; }