Skip to contentSkip to conversation

drm/amd/display: remove redundant null pointer check before kfree

PATCH Applied zhong jiang 3 participants 3 messages Oct 30, 2019

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: remove redundant null pointer check before kfree

kfree has taken null pointer into account. hence it is safe to remove the unnecessary check.

---
 drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +1 -3
index cf6ef38..6f730b5 100644
@@ -174,9 +174,7 @@ static bool hdmi_14_process_transaction(
 			link->ctx,
 			link,
 			&i2c_command);
-
-	if (buff)
-		kfree(buff);
+	kfree(buff);
 
 	return result;
 }
Signature · 1 line
1.7.12.4
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · zhong jiang

kfree has taken null pointer into account. hence it is safe to remove the unnecessary check.

Harry

Quoted 20 lines
---
 drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +1 -3
index cf6ef38..6f730b5 100644
@@ -174,9 +174,7 @@ static bool hdmi_14_process_transaction(
 			link->ctx,
 			link,
 			&i2c_command);
-
-	if (buff)
-		kfree(buff);
+	kfree(buff);
 
 	return result;
 }
Applied
#2 lore raw
Quoted 9 lines · Harry Wentland
Quoted 4 lines · zhong jiang

kfree has taken null pointer into account. hence it is safe to remove the unnecessary check.

Applied. thanks!

Alex

Quoted 26 lines

Harry

Quoted 10 lines
---
 drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +0 -0
index cf6ef38..6f730b5 100644

drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c static bool hdmi_14_process_transaction( · line 180

Quoted 10 lines
drivers/gpu/drm/amd/display/dc/hdcp/hdcp_msg.c +1 -3
@@ -174,9 +174,7 @@ static bool hdmi_14_process_transaction(
                      link->ctx,
                      link,
                      &i2c_command);
-
-     if (buff)
-             kfree(buff);
+     kfree(buff);
 
      return result;
 }

_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel