xen/irq: Propagate the error from init_one_desc_irq() in init_*_irq_data()
PATCH v2 1/1 xen/irq: Propagate the error from init_one_desc_irq() in init_*_irq_data()
From: Julien Grall <[email protected]>
init_one_desc_irq() can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.
Spotted by coverity.
CID: 106529
---
Changes in v2:
- Add Roger's reviewed-by for x86
- Handle
--- xen/arch/arm/irq.c | 12 ++++++++++-- xen/arch/x86/irq.c | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-)
xen/arch/arm/irq.c +10 -2
@@ -88,7 +88,11 @@ static int __init init_irq_data(void)for ( irq =NR_LOCAL_IRQS ; irq <NR_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ; }
@@ -105,7 +109,11 @@ static int init_local_irq_data(void)for ( irq =0 ; irq <NR_LOCAL_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ;
xen/arch/x86/irq.c +6 -1
@@ -428,9 +428,14 @@ int __init init_irq_data(void)for ( irq =0 ; irq < nr_irqs_gsi; irq++ ) { +int rc; + desc =irq_to_desc (irq); desc->irq = irq; -init_one_irq_desc (desc); + + rc =init_one_irq_desc (desc); +if ( rc ) +return rc; }for ( ; irq < nr_irqs; irq++ )irq_to_desc (irq)->irq = irq;
Signature · 1 line
2.17.1
Hi Julien,
Quoted 7 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.
Quoted 6 lines
Spotted by coverity.
CID: 106529
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>
For ARM part, obviously.
Quoted 60 lines
---
Changes in v2:
- Add Roger's reviewed-by for x86
- Handle--- xen/arch/arm/irq.c | 12 ++++++++++-- xen/arch/x86/irq.c | 7 ++++++- 2 files changed, 16 insertions(+), 3 deletions(-)xen/arch/arm/irq.c +10
-2@@ -88,7 +88,11 @@ static int __init init_irq_data(void)for ( irq =NR_LOCAL_IRQS ; irq <NR_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ; }@@ -105,7 +109,11 @@ static int init_local_irq_data(void)for ( irq =0 ; irq <NR_LOCAL_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ;xen/arch/x86/irq.c +6
-1@@ -428,9 +428,14 @@ int __init init_irq_data(void)for ( irq =0 ; irq < nr_irqs_gsi; irq++ ) { +int rc; + desc =irq_to_desc (irq); desc->irq = irq; -init_one_irq_desc (desc); + + rc =init_one_irq_desc (desc); +if ( rc ) +return rc; }for ( ; irq < nr_irqs; irq++ )irq_to_desc (irq)->irq = irq;
Signature · 1 line
Volodymyr Babchuk at EPAM
Quoted 11 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.
Quoted 6 lines
Spotted by coverity.
CID: 106529
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>
Cheers
Bertrand
Quoted 64 lines
---
Changes in v2:
- Add Roger's reviewed-by for x86
- Handle
---xen/arch/arm/irq.c| 12 ++++++++++--xen/arch/x86/irq.c| 7 ++++++-2 files changed, 16 insertions(+), 3 deletions(-)xen/arch/arm/irq.c +10
-2@@ -88,7 +88,11 @@ static int __init init_irq_data(void)for ( irq =NR_LOCAL_IRQS ; irq <NR_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ; }@@ -105,7 +109,11 @@ static int init_local_irq_data(void)for ( irq =0 ; irq <NR_LOCAL_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ;xen/arch/x86/irq.c +6
-1@@ -428,9 +428,14 @@ int __init init_irq_data(void)for ( irq =0 ; irq < nr_irqs_gsi; irq++ ) { +int rc; + desc =irq_to_desc (irq); desc->irq = irq; -init_one_irq_desc (desc); + + rc =init_one_irq_desc (desc); +if ( rc ) +return rc; }for ( ; irq < nr_irqs; irq++ )irq_to_desc (irq)->irq = irq;Signature · 1 line
2.17.1
Stefano Stabellini
Acked-byQuoted 9 lines · Bertrand Marquis
Quoted 9 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.
Quoted 8 lines
Quoted 6 lines
Spotted by coverity.
CID: 106529
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>Reviewed-by Bertrand Marquis <[email protected]>
Quoted 65 lines
Quoted 63 lines
---
Changes in v2:
- Add Roger's reviewed-by for x86
- Handle
---xen/arch/arm/irq.c| 12 ++++++++++--xen/arch/x86/irq.c| 7 ++++++-2 files changed, 16 insertions(+), 3 deletions(-)xen/arch/arm/irq.c +10
-2@@ -88,7 +88,11 @@ static int __init init_irq_data(void)for ( irq =NR_LOCAL_IRQS ; irq <NR_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ; }@@ -105,7 +109,11 @@ static int init_local_irq_data(void)for ( irq =0 ; irq <NR_LOCAL_IRQS ; irq++ ) {struct irq_desc *desc =irq_to_desc (irq); -init_one_irq_desc (desc); +int rc =init_one_irq_desc (desc); + +if ( rc ) +return rc; + desc->irq = irq; desc->action =NULL ;xen/arch/x86/irq.c +6
-1@@ -428,9 +428,14 @@ int __init init_irq_data(void)for ( irq =0 ; irq < nr_irqs_gsi; irq++ ) { +int rc; + desc =irq_to_desc (irq); desc->irq = irq; -init_one_irq_desc (desc); + + rc =init_one_irq_desc (desc); +if ( rc ) +return rc; }for ( ; irq < nr_irqs; irq++ )irq_to_desc (irq)->irq = irq;Signature · 1 line
2.17.1
Hi all,
Quoted 7 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.
Quoted 6 lines
Spotted by coverity.
CID: 106529
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>
From my understanding of MAINTAINERS rule, I still need an ack from x86 maintainers.
Cheers,
Signature · 1 line
Julien Grall
Quoted 10 lines · Julien Grall
Quoted 9 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.Spotted by coverity.
Quoted 7 lines
Quoted 4 lines
CID: 106529
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>From my understanding of
MAINTAINERSrule, I still need an ack from x86
maintainers.
Roger _is_ an x86 maintainer, so why would you need another ack?
Jan
Quoted 13 lines · Jan Beulich
Quoted 12 lines · Julien Grall
Quoted 11 lines · Julien Grall
From: Julien Grall <[email protected]>
init_one_desc_irq()can return an error if it is unable to allocate memory. While this is unlikely to happen during boot (called from init_{,local_}irq_data()), it is better to harden the code by propagting the return value.Spotted by coverity.
CID: 106529
Quoted 7 lines
Quoted 5 lines
Quoted 2 lines
Signed-off-by Julien Grall <[email protected]>Reviewed-by Roger Paul Monné <[email protected]>From my understanding of
MAINTAINERSrule, I still need an ack from x86
maintainers.Roger _is_ an x86 maintainer, so why would you need another ack?
Because I didn't realize that Roger became an x86 Maintainer...
I will commit the patch then.
Cheers,
Signature · 1 line
Julien Grall