All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xen: remove unnecessary condition check before kfree
@ 2018-09-08 14:18 zhong jiang
  2018-09-10  9:52 ` Juergen Gross
  2018-09-10  9:52 ` Juergen Gross
  0 siblings, 2 replies; 6+ messages in thread
From: zhong jiang @ 2018-09-08 14:18 UTC (permalink / raw)
  To: boris.ostrovsky, jgross; +Cc: xen-devel, linux-kernel

kfree has taken null pointer into account. So just remove the
condition check before kfree.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/xen/xen-acpi-processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index fbb9137..7e1d49e 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
 		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
 			ret, _pr->acpi_id);
 err_free:
-	if (!IS_ERR_OR_NULL(dst_states))
+	if (!IS_ERR(dst_states))
 		kfree(dst_states);
 
 	return ret;
-- 
1.7.12.4


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

* Re: [PATCH] xen: remove unnecessary condition check before kfree
  2018-09-08 14:18 [PATCH] xen: remove unnecessary condition check before kfree zhong jiang
@ 2018-09-10  9:52 ` Juergen Gross
  2018-09-10 13:52   ` zhong jiang
  2018-09-10 13:52   ` zhong jiang
  2018-09-10  9:52 ` Juergen Gross
  1 sibling, 2 replies; 6+ messages in thread
From: Juergen Gross @ 2018-09-10  9:52 UTC (permalink / raw)
  To: zhong jiang, boris.ostrovsky; +Cc: xen-devel, linux-kernel

On 08/09/18 16:18, zhong jiang wrote:
> kfree has taken null pointer into account. So just remove the
> condition check before kfree.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/xen/xen-acpi-processor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
> index fbb9137..7e1d49e 100644
> --- a/drivers/xen/xen-acpi-processor.c
> +++ b/drivers/xen/xen-acpi-processor.c
> @@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
>  		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
>  			ret, _pr->acpi_id);
>  err_free:
> -	if (!IS_ERR_OR_NULL(dst_states))
> +	if (!IS_ERR(dst_states))

This is just a change of the condition, not a removal.

I don't think change is worth it.


Juergen

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

* Re: [PATCH] xen: remove unnecessary condition check before kfree
  2018-09-08 14:18 [PATCH] xen: remove unnecessary condition check before kfree zhong jiang
  2018-09-10  9:52 ` Juergen Gross
@ 2018-09-10  9:52 ` Juergen Gross
  1 sibling, 0 replies; 6+ messages in thread
From: Juergen Gross @ 2018-09-10  9:52 UTC (permalink / raw)
  To: zhong jiang, boris.ostrovsky; +Cc: xen-devel, linux-kernel

On 08/09/18 16:18, zhong jiang wrote:
> kfree has taken null pointer into account. So just remove the
> condition check before kfree.
> 
> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
> ---
>  drivers/xen/xen-acpi-processor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
> index fbb9137..7e1d49e 100644
> --- a/drivers/xen/xen-acpi-processor.c
> +++ b/drivers/xen/xen-acpi-processor.c
> @@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
>  		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
>  			ret, _pr->acpi_id);
>  err_free:
> -	if (!IS_ERR_OR_NULL(dst_states))
> +	if (!IS_ERR(dst_states))

This is just a change of the condition, not a removal.

I don't think change is worth it.


Juergen

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* Re: [PATCH] xen: remove unnecessary condition check before kfree
  2018-09-10  9:52 ` Juergen Gross
  2018-09-10 13:52   ` zhong jiang
@ 2018-09-10 13:52   ` zhong jiang
  1 sibling, 0 replies; 6+ messages in thread
From: zhong jiang @ 2018-09-10 13:52 UTC (permalink / raw)
  To: Juergen Gross; +Cc: boris.ostrovsky, xen-devel, linux-kernel

On 2018/9/10 17:52, Juergen Gross wrote:
> On 08/09/18 16:18, zhong jiang wrote:
>> kfree has taken null pointer into account. So just remove the
>> condition check before kfree.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/xen/xen-acpi-processor.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
>> index fbb9137..7e1d49e 100644
>> --- a/drivers/xen/xen-acpi-processor.c
>> +++ b/drivers/xen/xen-acpi-processor.c
>> @@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
>>  		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
>>  			ret, _pr->acpi_id);
>>  err_free:
>> -	if (!IS_ERR_OR_NULL(dst_states))
>> +	if (!IS_ERR(dst_states))
> This is just a change of the condition, not a removal.
>
> I don't think change is worth it.
>
 Fine, I just consider the duplication of function.  Of course. make sense you have said.
 Maybe it will more clear to have the judgement.

 Thanks,
 zhong jiang
> Juergen
>
>



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

* Re: [PATCH] xen: remove unnecessary condition check before kfree
  2018-09-10  9:52 ` Juergen Gross
@ 2018-09-10 13:52   ` zhong jiang
  2018-09-10 13:52   ` zhong jiang
  1 sibling, 0 replies; 6+ messages in thread
From: zhong jiang @ 2018-09-10 13:52 UTC (permalink / raw)
  To: Juergen Gross; +Cc: xen-devel, boris.ostrovsky, linux-kernel

On 2018/9/10 17:52, Juergen Gross wrote:
> On 08/09/18 16:18, zhong jiang wrote:
>> kfree has taken null pointer into account. So just remove the
>> condition check before kfree.
>>
>> Signed-off-by: zhong jiang <zhongjiang@huawei.com>
>> ---
>>  drivers/xen/xen-acpi-processor.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
>> index fbb9137..7e1d49e 100644
>> --- a/drivers/xen/xen-acpi-processor.c
>> +++ b/drivers/xen/xen-acpi-processor.c
>> @@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
>>  		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
>>  			ret, _pr->acpi_id);
>>  err_free:
>> -	if (!IS_ERR_OR_NULL(dst_states))
>> +	if (!IS_ERR(dst_states))
> This is just a change of the condition, not a removal.
>
> I don't think change is worth it.
>
 Fine, I just consider the duplication of function.  Of course. make sense you have said.
 Maybe it will more clear to have the judgement.

 Thanks,
 zhong jiang
> Juergen
>
>



_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

* [PATCH] xen: remove unnecessary condition check before kfree
@ 2018-09-08 14:18 zhong jiang
  0 siblings, 0 replies; 6+ messages in thread
From: zhong jiang @ 2018-09-08 14:18 UTC (permalink / raw)
  To: boris.ostrovsky, jgross; +Cc: xen-devel, linux-kernel

kfree has taken null pointer into account. So just remove the
condition check before kfree.

Signed-off-by: zhong jiang <zhongjiang@huawei.com>
---
 drivers/xen/xen-acpi-processor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/xen/xen-acpi-processor.c b/drivers/xen/xen-acpi-processor.c
index fbb9137..7e1d49e 100644
--- a/drivers/xen/xen-acpi-processor.c
+++ b/drivers/xen/xen-acpi-processor.c
@@ -268,7 +268,7 @@ static int push_pxx_to_hypervisor(struct acpi_processor *_pr)
 		pr_warn("(_PXX): Hypervisor error (%d) for ACPI CPU%u\n",
 			ret, _pr->acpi_id);
 err_free:
-	if (!IS_ERR_OR_NULL(dst_states))
+	if (!IS_ERR(dst_states))
 		kfree(dst_states);
 
 	return ret;
-- 
1.7.12.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

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

end of thread, other threads:[~2018-09-10 13:53 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-08 14:18 [PATCH] xen: remove unnecessary condition check before kfree zhong jiang
2018-09-10  9:52 ` Juergen Gross
2018-09-10 13:52   ` zhong jiang
2018-09-10 13:52   ` zhong jiang
2018-09-10  9:52 ` Juergen Gross
  -- strict thread matches above, loose matches on Subject: below --
2018-09-08 14:18 zhong jiang

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.