All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
       [not found]   ` <18ebd398-9eeb-54e7-96ff-19a1c34bdcd3-5C7GfCeVMHo@public.gmane.org>
@ 2018-09-21 14:10     ` zhong jiang
       [not found]       ` <5BA4FBCD.6080102-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
  0 siblings, 1 reply; 9+ messages in thread
From: zhong jiang @ 2018-09-21 14:10 UTC (permalink / raw)
  To: Harry Wentland
  Cc: David1.Zhou-5C7GfCeVMHo, Aric.Cyr-5C7GfCeVMHo,
	keescook-F7+t8E8rja9g9hUCZPvPmw, sunpeng.li-5C7GfCeVMHo,
	Anthony.Koo-5C7GfCeVMHo, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	airlied-cv59FeDIM0c, alexander.deucher-5C7GfCeVMHo,
	Tony.Cheng-5C7GfCeVMHo

On 2018/9/21 21:56, Harry Wentland wrote:
> On 2018-09-21 09:12 AM, zhong jiang wrote:
>> kfree has taken the null pointer into account. hence it is safe
>> to remove the redundant null pointer check before kfree.
>>
> Please send patches for drivers/gpu/drm/amd to amd-gfx@lists.freedesktop.org for review.
+cc amd-gfx@lists.freedesktop.org. Do I need to resend it ?

Sincerely,
zhong jiang
> Harry
>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/gpu/drm/amd/display/modules/stats/stats.c | 8 ++------
>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c
>> index 3d4c1b1..03121ca 100644
>> --- a/drivers/gpu/drm/amd/display/modules/stats/stats.c
>> +++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c
>> @@ -186,12 +186,8 @@ void mod_stats_destroy(struct mod_stats *mod_stats)
>>  	if (mod_stats != NULL) {
>>  		struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats);
>>  
>> -		if (core_stats->time != NULL)
>> -			kfree(core_stats->time);
>> -
>> -		if (core_stats->events != NULL)
>> -			kfree(core_stats->events);
>> -
>> +		kfree(core_stats->time);
>> +		kfree(core_stats->events);
>>  		kfree(core_stats);
>>  	}
>>  }
>>
>


_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
       [not found]       ` <5BA4FBCD.6080102-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
@ 2018-09-21 15:00         ` Harry Wentland
  0 siblings, 0 replies; 9+ messages in thread
From: Harry Wentland @ 2018-09-21 15:00 UTC (permalink / raw)
  To: zhong jiang
  Cc: David1.Zhou-5C7GfCeVMHo, Aric.Cyr-5C7GfCeVMHo,
	keescook-F7+t8E8rja9g9hUCZPvPmw, sunpeng.li-5C7GfCeVMHo,
	Anthony.Koo-5C7GfCeVMHo, amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	airlied-cv59FeDIM0c, alexander.deucher-5C7GfCeVMHo,
	Tony.Cheng-5C7GfCeVMHo

On 2018-09-21 10:10 AM, zhong jiang wrote:
> On 2018/9/21 21:56, Harry Wentland wrote:
>> On 2018-09-21 09:12 AM, zhong jiang wrote:
>>> kfree has taken the null pointer into account. hence it is safe
>>> to remove the redundant null pointer check before kfree.
>>>
>> Please send patches for drivers/gpu/drm/amd to amd-gfx@lists.freedesktop.org for review.
> +cc amd-gfx@lists.freedesktop.org. Do I need to resend it ?
> 

Thanks. No need this time. Next time send to amd-gfx directly.

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

I'll pull it in.

Harry


> Sincerely,
> zhong jiang
>> Harry
>>
>>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>>> ---
>>>  drivers/gpu/drm/amd/display/modules/stats/stats.c | 8 ++------
>>>  1 file changed, 2 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/amd/display/modules/stats/stats.c b/drivers/gpu/drm/amd/display/modules/stats/stats.c
>>> index 3d4c1b1..03121ca 100644
>>> --- a/drivers/gpu/drm/amd/display/modules/stats/stats.c
>>> +++ b/drivers/gpu/drm/amd/display/modules/stats/stats.c
>>> @@ -186,12 +186,8 @@ void mod_stats_destroy(struct mod_stats *mod_stats)
>>>  	if (mod_stats != NULL) {
>>>  		struct core_stats *core_stats = MOD_STATS_TO_CORE(mod_stats);
>>>  
>>> -		if (core_stats->time != NULL)
>>> -			kfree(core_stats->time);
>>> -
>>> -		if (core_stats->events != NULL)
>>> -			kfree(core_stats->events);
>>> -
>>> +		kfree(core_stats->time);
>>> +		kfree(core_stats->events);
>>>  		kfree(core_stats);
>>>  	}
>>>  }
>>>
>>
> 
> 
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

* [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30  1:57 ` zhong jiang
  0 siblings, 0 replies; 9+ 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] 9+ messages in thread

* [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30  1:57 ` zhong jiang
  0 siblings, 0 replies; 9+ messages in thread
From: zhong jiang @ 2019-10-30  1:57 UTC (permalink / raw)
  To: harry.wentland, sunpeng.li, alexander.deucher
  Cc: airlied, linux-kernel, dri-devel, zhongjiang, christian.koenig

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

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30  1:57 ` zhong jiang
  0 siblings, 0 replies; 9+ 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] 9+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30 13:36   ` Harry Wentland
  0 siblings, 0 replies; 9+ 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@linux.ie,
	daniel@ffwll.ch, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org

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] 9+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30 13:36   ` Harry Wentland
  0 siblings, 0 replies; 9+ 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: airlied@linux.ie, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, Koenig, Christian

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

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

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30 13:56     ` Alex Deucher
  0 siblings, 0 replies; 9+ 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.ie,
	linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org,
	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] 9+ messages in thread

* Re: [PATCH] drm/amd/display: remove redundant null pointer check before kfree
@ 2019-10-30 13:56     ` Alex Deucher
  0 siblings, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2019-10-30 13:56 UTC (permalink / raw)
  To: Harry Wentland
  Cc: Li, Sun peng (Leo), zhong jiang, linux-kernel@vger.kernel.org,
	dri-devel@lists.freedesktop.org, airlied@linux.ie,
	Deucher, Alexander, 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
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

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

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1537535531-45918-1-git-send-email-zhongjiang@huawei.com>
     [not found] ` <18ebd398-9eeb-54e7-96ff-19a1c34bdcd3@amd.com>
     [not found]   ` <18ebd398-9eeb-54e7-96ff-19a1c34bdcd3-5C7GfCeVMHo@public.gmane.org>
2018-09-21 14:10     ` [PATCH] drm/amd/display: remove redundant null pointer check before kfree zhong jiang
     [not found]       ` <5BA4FBCD.6080102-hv44wF8Li93QT0dZR+AlfA@public.gmane.org>
2018-09-21 15:00         ` Harry Wentland
2019-10-30  1:57 zhong jiang
2019-10-30  1:57 ` zhong jiang
2019-10-30  1:57 ` zhong jiang
2019-10-30 13:36 ` Harry Wentland
2019-10-30 13:36   ` Harry Wentland
2019-10-30 13:56   ` Alex Deucher
2019-10-30 13:56     ` Alex Deucher

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.