2019-07-26 01:56:23

by Zhangshaokun

[permalink] [raw]
Subject: [PATCH] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail

From: Nianyao Tang <[email protected]>

In its_vpe_init, when its_alloc_vpe_table fails, we should free
vpt_page allocated just before, instead of vpe->vpt_page.
Let's fix it.

Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Marc Zyngier <[email protected]>
Signed-off-by: Nianyao Tang <[email protected]>
---
drivers/irqchip/irq-gic-v3-its.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 730fbe0..1b5c367 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe)

if (!its_alloc_vpe_table(vpe_id)) {
its_vpe_id_free(vpe_id);
- its_free_pending_table(vpe->vpt_page);
+ its_free_pending_table(vpt_page);
return -ENOMEM;
}

--
2.7.4



2019-07-26 09:19:52

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail

On Fri, 26 Jul 2019 09:51:45 +0800
Shaokun Zhang <[email protected]> wrote:

> From: Nianyao Tang <[email protected]>
>
> In its_vpe_init, when its_alloc_vpe_table fails, we should free
> vpt_page allocated just before, instead of vpe->vpt_page.
> Let's fix it.
>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Marc Zyngier <[email protected]>
> Signed-off-by: Nianyao Tang <[email protected]>
> ---
> drivers/irqchip/irq-gic-v3-its.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 730fbe0..1b5c367 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe)
>
> if (!its_alloc_vpe_table(vpe_id)) {
> its_vpe_id_free(vpe_id);
> - its_free_pending_table(vpe->vpt_page);
> + its_free_pending_table(vpt_page);
> return -ENOMEM;
> }
>

Oops, well caught. Please repost this patch with your own SoB added
though, as you're posting the patch on behalf of someone else.

Thanks,

M.
--
Without deviation from the norm, progress is not possible.

2019-07-26 09:25:38

by Zhangshaokun

[permalink] [raw]
Subject: Re: [PATCH] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail

Hi Marc,

On 2019/7/26 17:18, Marc Zyngier wrote:
> On Fri, 26 Jul 2019 09:51:45 +0800
> Shaokun Zhang <[email protected]> wrote:
>
>> From: Nianyao Tang <[email protected]>
>>
>> In its_vpe_init, when its_alloc_vpe_table fails, we should free
>> vpt_page allocated just before, instead of vpe->vpt_page.
>> Let's fix it.
>>
>> Cc: Thomas Gleixner <[email protected]>
>> Cc: Jason Cooper <[email protected]>
>> Cc: Marc Zyngier <[email protected]>
>> Signed-off-by: Nianyao Tang <[email protected]>
>> ---
>> drivers/irqchip/irq-gic-v3-its.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
>> index 730fbe0..1b5c367 100644
>> --- a/drivers/irqchip/irq-gic-v3-its.c
>> +++ b/drivers/irqchip/irq-gic-v3-its.c
>> @@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe)
>>
>> if (!its_alloc_vpe_table(vpe_id)) {
>> its_vpe_id_free(vpe_id);
>> - its_free_pending_table(vpe->vpt_page);
>> + its_free_pending_table(vpt_page);
>> return -ENOMEM;
>> }
>>
>
> Oops, well caught. Please repost this patch with your own SoB added
> though, as you're posting the patch on behalf of someone else.
>

Thanks your reminder and I will do it in v2 version.

Shaokun

> Thanks,
>
> M.
>


2019-07-26 09:36:24

by Zhangshaokun

[permalink] [raw]
Subject: [PATCH v2] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail

From: Nianyao Tang <[email protected]>

In its_vpe_init, when its_alloc_vpe_table fails, we should free
vpt_page allocated just before, instead of vpe->vpt_page.
Let's fix it.

Cc: Thomas Gleixner <[email protected]>
Cc: Jason Cooper <[email protected]>
Cc: Marc Zyngier <[email protected]>
Signed-off-by: Nianyao Tang <[email protected]>
Signed-off-by: Shaokun Zhang <[email protected]>
---
drivers/irqchip/irq-gic-v3-its.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
index 730fbe0e2a9d..1b5c3672aea2 100644
--- a/drivers/irqchip/irq-gic-v3-its.c
+++ b/drivers/irqchip/irq-gic-v3-its.c
@@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe)

if (!its_alloc_vpe_table(vpe_id)) {
its_vpe_id_free(vpe_id);
- its_free_pending_table(vpe->vpt_page);
+ its_free_pending_table(vpt_page);
return -ENOMEM;
}

--
2.7.4


2019-07-26 13:19:52

by Marc Zyngier

[permalink] [raw]
Subject: Re: [PATCH v2] irqchip/gic-v3-its: Free unused vpt_page when alloc vpe table fail

On Fri, 26 Jul 2019 10:32:57 +0100,
Shaokun Zhang <[email protected]> wrote:
>
> From: Nianyao Tang <[email protected]>
>
> In its_vpe_init, when its_alloc_vpe_table fails, we should free
> vpt_page allocated just before, instead of vpe->vpt_page.
> Let's fix it.
>
> Cc: Thomas Gleixner <[email protected]>
> Cc: Jason Cooper <[email protected]>
> Cc: Marc Zyngier <[email protected]>
> Signed-off-by: Nianyao Tang <[email protected]>
> Signed-off-by: Shaokun Zhang <[email protected]>
> ---
> drivers/irqchip/irq-gic-v3-its.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/irqchip/irq-gic-v3-its.c b/drivers/irqchip/irq-gic-v3-its.c
> index 730fbe0e2a9d..1b5c3672aea2 100644
> --- a/drivers/irqchip/irq-gic-v3-its.c
> +++ b/drivers/irqchip/irq-gic-v3-its.c
> @@ -3010,7 +3010,7 @@ static int its_vpe_init(struct its_vpe *vpe)
>
> if (!its_alloc_vpe_table(vpe_id)) {
> its_vpe_id_free(vpe_id);
> - its_free_pending_table(vpe->vpt_page);
> + its_free_pending_table(vpt_page);
> return -ENOMEM;
> }
>
> --
> 2.7.4
>

Applied, thanks.

M.

--
Jazz is not dead, it just smells funny.