mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] ACPI: NFIT: Fix incorrect calculation of idt size
       [not found] <20230817091124.915407-1-liaoyu15@huawei.com>
@ 2023-08-25  3:59 ` Yu Liao
  2023-08-25 15:09   ` Dave Jiang
  0 siblings, 1 reply; 3+ messages in thread
From: Yu Liao @ 2023-08-25  3:59 UTC (permalink / raw)
  To: dan.j.williams, vishal.l.verma, dave.jiang, ira.weiny, rafael
  Cc: liwei391, lenb, robert.moore, linux-acpi, linux-kernel

Hi,

A kindly ping, any comment on this?

Best regards,
Yu


On 2023/8/17 17:11, Yu Liao wrote:
> acpi_nfit_interleave's field 'line_offset' is switched to flexible array [1],
> but sizeof_idt() still calculates the size in the form of 1-element array.
> 
> Therefore, fix incorrect calculation in sizeof_idt().
> 
> [1] https://lore.kernel.org/lkml/2652195.BddDVKsqQX@kreacher/
> 
> Fixes: 2a5ab99847bd ("ACPICA: struct acpi_nfit_interleave: Replace 1-element array with flexible array")
> Cc: stable@vger.kernel.org # v6.4+
> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
> ---
>  drivers/acpi/nfit/core.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
> index 07204d482968..305f590c54a8 100644
> --- a/drivers/acpi/nfit/core.c
> +++ b/drivers/acpi/nfit/core.c
> @@ -855,7 +855,7 @@ static size_t sizeof_idt(struct acpi_nfit_interleave *idt)
>  {
>  	if (idt->header.length < sizeof(*idt))
>  		return 0;
> -	return sizeof(*idt) + sizeof(u32) * (idt->line_count - 1);
> +	return sizeof(*idt) + sizeof(u32) * idt->line_count;
>  }
>  
>  static bool add_idt(struct acpi_nfit_desc *acpi_desc,


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

* Re: [PATCH 1/2] ACPI: NFIT: Fix incorrect calculation of idt size
  2023-08-25  3:59 ` [PATCH 1/2] ACPI: NFIT: Fix incorrect calculation of idt size Yu Liao
@ 2023-08-25 15:09   ` Dave Jiang
  2023-08-26  4:37     ` Yu Liao
  0 siblings, 1 reply; 3+ messages in thread
From: Dave Jiang @ 2023-08-25 15:09 UTC (permalink / raw)
  To: Yu Liao, dan.j.williams, vishal.l.verma, ira.weiny, rafael
  Cc: liwei391, lenb, robert.moore, linux-acpi, linux-kernel



On 8/24/23 20:59, Yu Liao wrote:
> Hi,
> 
> A kindly ping, any comment on this?

You can add my review tag to both of your patches in the series. Please 
cc nvdimm@lists.linux.dev next time as well for nfit. Thanks!

Reviewed-by: Dave Jiang <dave.jiang@intel.com>

> 
> Best regards,
> Yu
> 
> 
> On 2023/8/17 17:11, Yu Liao wrote:
>> acpi_nfit_interleave's field 'line_offset' is switched to flexible array [1],
>> but sizeof_idt() still calculates the size in the form of 1-element array.
>>
>> Therefore, fix incorrect calculation in sizeof_idt().
>>
>> [1] https://lore.kernel.org/lkml/2652195.BddDVKsqQX@kreacher/
>>
>> Fixes: 2a5ab99847bd ("ACPICA: struct acpi_nfit_interleave: Replace 1-element array with flexible array")
>> Cc: stable@vger.kernel.org # v6.4+
>> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
>> ---
>>   drivers/acpi/nfit/core.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
>> index 07204d482968..305f590c54a8 100644
>> --- a/drivers/acpi/nfit/core.c
>> +++ b/drivers/acpi/nfit/core.c
>> @@ -855,7 +855,7 @@ static size_t sizeof_idt(struct acpi_nfit_interleave *idt)
>>   {
>>   	if (idt->header.length < sizeof(*idt))
>>   		return 0;
>> -	return sizeof(*idt) + sizeof(u32) * (idt->line_count - 1);
>> +	return sizeof(*idt) + sizeof(u32) * idt->line_count;
>>   }
>>   
>>   static bool add_idt(struct acpi_nfit_desc *acpi_desc,
> 

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

* Re: [PATCH 1/2] ACPI: NFIT: Fix incorrect calculation of idt size
  2023-08-25 15:09   ` Dave Jiang
@ 2023-08-26  4:37     ` Yu Liao
  0 siblings, 0 replies; 3+ messages in thread
From: Yu Liao @ 2023-08-26  4:37 UTC (permalink / raw)
  To: Dave Jiang, dan.j.williams, vishal.l.verma, ira.weiny, rafael
  Cc: liwei391, lenb, robert.moore, linux-acpi, linux-kernel

On 2023/8/25 23:09, Dave Jiang wrote:
> 
> 
> On 8/24/23 20:59, Yu Liao wrote:
>> Hi,
>>
>> A kindly ping, any comment on this?
> 
> You can add my review tag to both of your patches in the series. Please cc
> nvdimm@lists.linux.dev next time as well for nfit. Thanks!

Thank you for the review. I'll make the suggested changes and send you
the V2.

Best regards,
Yu
> 
> Reviewed-by: Dave Jiang <dave.jiang@intel.com>
> 
>>
>> Best regards,
>> Yu
>>
>>
>> On 2023/8/17 17:11, Yu Liao wrote:
>>> acpi_nfit_interleave's field 'line_offset' is switched to flexible array [1],
>>> but sizeof_idt() still calculates the size in the form of 1-element array.
>>>
>>> Therefore, fix incorrect calculation in sizeof_idt().
>>>
>>> [1] https://lore.kernel.org/lkml/2652195.BddDVKsqQX@kreacher/
>>>
>>> Fixes: 2a5ab99847bd ("ACPICA: struct acpi_nfit_interleave: Replace
>>> 1-element array with flexible array")
>>> Cc: stable@vger.kernel.org # v6.4+
>>> Signed-off-by: Yu Liao <liaoyu15@huawei.com>
>>> ---
>>>   drivers/acpi/nfit/core.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c
>>> index 07204d482968..305f590c54a8 100644
>>> --- a/drivers/acpi/nfit/core.c
>>> +++ b/drivers/acpi/nfit/core.c
>>> @@ -855,7 +855,7 @@ static size_t sizeof_idt(struct acpi_nfit_interleave *idt)
>>>   {
>>>       if (idt->header.length < sizeof(*idt))
>>>           return 0;
>>> -    return sizeof(*idt) + sizeof(u32) * (idt->line_count - 1);
>>> +    return sizeof(*idt) + sizeof(u32) * idt->line_count;
>>>   }
>>>     static bool add_idt(struct acpi_nfit_desc *acpi_desc,
>>


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

end of thread, other threads:[~2023-08-26  4:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <20230817091124.915407-1-liaoyu15@huawei.com>
2023-08-25  3:59 ` [PATCH 1/2] ACPI: NFIT: Fix incorrect calculation of idt size Yu Liao
2023-08-25 15:09   ` Dave Jiang
2023-08-26  4:37     ` Yu Liao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®