linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30  1:57 zhong jiang
  2019-10-30 13:36 ` Harry Wentland
  0 siblings, 1 reply; 3+ messages in thread
From: zhong jiang @ 2019-10-30  1:57 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher
  Cc: christian.koenig, David1.Zhou, airlied, daniel, zhongjiang,
	dri-devel, linux-kernel

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

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
  2019-10-30  1:57 [PATCH] drm/amd/display: remove redundant null pointer check before kfree zhong jiang
@ 2019-10-30 13:36 ` Harry Wentland
  2019-10-30 13:56   ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Harry Wentland @ 2019-10-30 13:36 UTC (permalink / raw)
  To: zhong jiang, Wentland, Harry, Li, Sun peng (Leo), Deucher, Alexander
  Cc: Koenig, Christian, Zhou, David(ChunMing),
	airlied, daniel, dri-devel, linux-kernel

On 2019-10-29 9:57 p.m., zhong jiang wrote:
> kfree has taken null pointer into account. hence it is safe to remove
> the unnecessary check.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>

Reviewed-by: Harry Wentland <harry.wentland@amd.com>

Harry

> ---
>  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;
>  }
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
  2019-10-30 13:36 ` Harry Wentland
@ 2019-10-30 13:56   ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2019-10-30 13:56 UTC (permalink / raw)
  To: Harry Wentland
  Cc: zhong jiang, Wentland, Harry, Li, Sun peng (Leo),
	Deucher, Alexander, airlied, linux-kernel, dri-devel, Koenig,
	Christian

On Wed, Oct 30, 2019 at 9:36 AM Harry Wentland <hwentlan@amd.com> wrote:
>
> On 2019-10-29 9:57 p.m., zhong jiang wrote:
> > kfree has taken null pointer into account. hence it is safe to remove
> > the unnecessary check.
> >
> > Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>
> Reviewed-by: Harry Wentland <harry.wentland@amd.com>
>

Applied.  thanks!

Alex

> Harry
>
> > ---
> >  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;
> >  }
> >
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-10-30 13:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  1:57 [PATCH] drm/amd/display: remove redundant null pointer check before kfree zhong jiang
2019-10-30 13:36 ` Harry Wentland
2019-10-30 13:56   ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).