lkml.org 
[lkml]   [2015]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Subject[PATCH] HDMI-HDCP: Delete an unnecessary check before the function call "kfree"
    From
    Date
    From: Markus Elfring <elfring@users.sourceforge.net>
    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 <elfring@users.sourceforge.net>
    ---
    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;
    }
    --
    2.6.2


    \
     
     \ /
      Last update: 2015-11-06 15:21    [W:4.027 / U:0.032 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site