OSDN Git Service

drm/amd/display: remove redundant null pointer check before kfree
authorzhong jiang <zhongjiang@huawei.com>
Wed, 30 Oct 2019 01:57:53 +0000 (09:57 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 30 Oct 2019 15:07:13 +0000 (11:07 -0400)
kfree has taken null pointer into account. hence it is safe to remove
the unnecessary check.

Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: zhong jiang <zhongjiang@huawei.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c

index cf6ef38..6f730b5 100644 (file)
@@ -174,9 +174,7 @@ static bool hdmi_14_process_transaction(
                        link->ctx,
                        link,
                        &i2c_command);
-
-       if (buff)
-               kfree(buff);
+       kfree(buff);
 
        return result;
 }