浏览代码

drm/msm/hdmi: Delete an unnecessary check before the function call "kfree"

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>
Signed-off-by: Rob Clark <robdclark@gmail.com>
Markus Elfring 9 年之前
父节点
当前提交
851dd75d64
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/gpu/drm/msm/hdmi/hdmi_hdcp.c

+ 1 - 1
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)
 void msm_hdmi_hdcp_destroy(struct hdmi *hdmi)
 {
 {
-	if (hdmi && hdmi->hdcp_ctrl) {
+	if (hdmi) {
 		kfree(hdmi->hdcp_ctrl);
 		kfree(hdmi->hdcp_ctrl);
 		hdmi->hdcp_ctrl = NULL;
 		hdmi->hdcp_ctrl = NULL;
 	}
 	}