linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt()
@ 2021-06-02  1:17 Jing Xiangfeng
  2021-06-02  7:28 ` Zhang Rui
  2021-06-02  9:21 ` Hanjun Guo
  0 siblings, 2 replies; 4+ messages in thread
From: Jing Xiangfeng @ 2021-06-02  1:17 UTC (permalink / raw)
  To: rjw, lenb, rui.zhang; +Cc: linux-acpi, linux-kernel, jingxiangfeng

acpi_init_fpdt() misses to call acpi_put_table() in an error path. Add
the missed function call to fix it.

Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table")
Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
---
 drivers/acpi/acpi_fpdt.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
index a89a806a7a2a..4ee2ad234e3d 100644
--- a/drivers/acpi/acpi_fpdt.c
+++ b/drivers/acpi/acpi_fpdt.c
@@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
 		return 0;
 
 	fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
-	if (!fpdt_kobj)
+	if (!fpdt_kobj) {
+		acpi_put_table(header);
 		return -ENOMEM;
+	}
 
 	while (offset < header->length) {
 		subtable = (void *)header + offset;
-- 
2.26.0.106.g9fadedd


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

* Re: [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt()
  2021-06-02  1:17 [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt() Jing Xiangfeng
@ 2021-06-02  7:28 ` Zhang Rui
  2021-06-02  9:21 ` Hanjun Guo
  1 sibling, 0 replies; 4+ messages in thread
From: Zhang Rui @ 2021-06-02  7:28 UTC (permalink / raw)
  To: Jing Xiangfeng, rjw, lenb; +Cc: linux-acpi, linux-kernel

Hi, Xiangfeng,

thanks for the patch.

On Wed, 2021-06-02 at 09:17 +0800, Jing Xiangfeng wrote:
> acpi_init_fpdt() misses to call acpi_put_table() in an error path.
> Add
> the missed function call to fix it.
> 
> Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT
> table")
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>

Acked-by: Zhang Rui <rui.zhang@intel.com>

thanks,
rui
> ---
>  drivers/acpi/acpi_fpdt.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
> index a89a806a7a2a..4ee2ad234e3d 100644
> --- a/drivers/acpi/acpi_fpdt.c
> +++ b/drivers/acpi/acpi_fpdt.c
> @@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
>  		return 0;
>  
>  	fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
> -	if (!fpdt_kobj)
> +	if (!fpdt_kobj) {
> +		acpi_put_table(header);
>  		return -ENOMEM;
> +	}
>  
>  	while (offset < header->length) {
>  		subtable = (void *)header + offset;


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

* Re: [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt()
  2021-06-02  1:17 [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt() Jing Xiangfeng
  2021-06-02  7:28 ` Zhang Rui
@ 2021-06-02  9:21 ` Hanjun Guo
  2021-06-02 11:06   ` Jing Xiangfeng
  1 sibling, 1 reply; 4+ messages in thread
From: Hanjun Guo @ 2021-06-02  9:21 UTC (permalink / raw)
  To: Jing Xiangfeng, rjw, lenb, rui.zhang; +Cc: linux-acpi, linux-kernel

The title of this patch is misleading, how about "ACPI: FPDT: Add the
missed acpi_put_table() in acpi_init_fpdt()" ?

On 2021/6/2 9:17, Jing Xiangfeng wrote:
> acpi_init_fpdt() misses to call acpi_put_table() in an error path. Add
> the missed function call to fix it.
> 
> Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table")
> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
> ---
>   drivers/acpi/acpi_fpdt.c | 4 +++-
>   1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
> index a89a806a7a2a..4ee2ad234e3d 100644
> --- a/drivers/acpi/acpi_fpdt.c
> +++ b/drivers/acpi/acpi_fpdt.c
> @@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
>   		return 0;
>   
>   	fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
> -	if (!fpdt_kobj)
> +	if (!fpdt_kobj) {
> +		acpi_put_table(header);
>   		return -ENOMEM;
> +	}

The code looks good to me.

Thanks
Hanjun

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

* Re: [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt()
  2021-06-02  9:21 ` Hanjun Guo
@ 2021-06-02 11:06   ` Jing Xiangfeng
  0 siblings, 0 replies; 4+ messages in thread
From: Jing Xiangfeng @ 2021-06-02 11:06 UTC (permalink / raw)
  To: Hanjun Guo, rjw, lenb, rui.zhang; +Cc: linux-acpi, linux-kernel



On 2021/6/2 17:21, Hanjun Guo wrote:
> The title of this patch is misleading, how about "ACPI: FPDT: Add the
> missed acpi_put_table() in acpi_init_fpdt()" ?
Thanks a lot for your comments! I'll send a v2 with this change.

>
> On 2021/6/2 9:17, Jing Xiangfeng wrote:
>> acpi_init_fpdt() misses to call acpi_put_table() in an error path. Add
>> the missed function call to fix it.
>>
>> Fixes: d1eb86e59be0 ("ACPI: tables: introduce support for FPDT table")
>> Signed-off-by: Jing Xiangfeng <jingxiangfeng@huawei.com>
>> ---
>>   drivers/acpi/acpi_fpdt.c | 4 +++-
>>   1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/acpi_fpdt.c b/drivers/acpi/acpi_fpdt.c
>> index a89a806a7a2a..4ee2ad234e3d 100644
>> --- a/drivers/acpi/acpi_fpdt.c
>> +++ b/drivers/acpi/acpi_fpdt.c
>> @@ -240,8 +240,10 @@ static int __init acpi_init_fpdt(void)
>>           return 0;
>>         fpdt_kobj = kobject_create_and_add("fpdt", acpi_kobj);
>> -    if (!fpdt_kobj)
>> +    if (!fpdt_kobj) {
>> +        acpi_put_table(header);
>>           return -ENOMEM;
>> +    }
>
> The code looks good to me.
>
> Thanks
> Hanjun
> .
>


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

end of thread, other threads:[~2021-06-02 11:06 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-02  1:17 [PATCH] ACPI: tables: fixes the missed acpi_put_table() in acpi_init_fpdt() Jing Xiangfeng
2021-06-02  7:28 ` Zhang Rui
2021-06-02  9:21 ` Hanjun Guo
2021-06-02 11:06   ` Jing Xiangfeng

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).