mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 02:01:24 +01:00
xen/irq: Propagate the error from init_one_desc_irq() in init_*_irq_data()
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
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Roger Paul Monné <roger.pau@citrix.com>
Reviewed-by: Volodymyr Babchuk <volodymyr_babchuk@epam.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
74cbc59b94
commit
2bb32b8092
2 files changed
+16
-3
No files matched your search
+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;
|
||||
|
||||
|
||||
+6
-1
@@ -432,9 +432,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;
|
||||
|
||||