Skip to content

Commit

Permalink
irqdomain: fix possible uninitialized variable in irq_find_mapping()
Browse files Browse the repository at this point in the history
In irq_find_mapping,ret value may be uninitialized.However,even if
the local variable irq is initialized, it only solves the uninitialized
problem and ret value is still an incorrect virq, so my modification
method is to set virq in __irq_resolve_mapping function.

Fixes: d22558d (“irqdomain: Introduce irq_resolve_mapping()”)
Signed-off-by: Xu Qiang <xuqiang36@huawei.com>
  • Loading branch information
Xu Qiang authored and intel-lab-lkp committed Jul 18, 2022
1 parent 036ad6d commit e09ea2c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/irq/irqdomain.c
Expand Up @@ -910,6 +910,8 @@ struct irq_desc *__irq_resolve_mapping(struct irq_domain *domain,
data = irq_domain_get_irq_data(domain, hwirq);
if (data && data->hwirq == hwirq)
desc = irq_data_to_desc(data);
if (irq && desc)
*irq = hwirq;
}

return desc;
Expand Down

0 comments on commit e09ea2c

Please sign in to comment.