From: zhong jiang Subject: [PATCH] drm/amd/display: remove redundant null pointer check before kfree Date: Wed, 30 Oct 2019 09:57:53 +0800 Message-ID: <1572400673-42535-1-git-send-email-zhongjiang@huawei.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Sender: linux-kernel-owner@vger.kernel.org To: harry.wentland@amd.com, sunpeng.li@amd.com, alexander.deucher@amd.com Cc: christian.koenig@amd.com, David1.Zhou@amd.com, airlied@linux.ie, daniel@ffwll.ch, zhongjiang@huawei.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org kfree has taken null pointer into account. hence it is safe to remove the unnecessary check. Signed-off-by: zhong jiang --- drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c b/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c index cf6ef38..6f730b5 100644 --- a/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +++ b/drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c @@ -174,9 +174,7 @@ static bool hdmi_14_process_transaction( link->ctx, link, &i2c_command); - - if (buff) - kfree(buff); + kfree(buff); return result; } -- 1.7.12.4