lkml.org 
[lkml]   [2020]   [Jun]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH v4 09/14] irqchip/mscc-ocelot: Fix potential resource leaks
    Date
    In the function ocelot_irq_init(), system resource "parent_irq"
    was not released in a few error cases. Thus add jump target for
    the completion of the desired exception handling.

    Fixes: 19d99164480a ("irqchip: Add a driver for the Microsemi Ocelot controller")
    Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
    ---
    drivers/irqchip/irq-mscc-ocelot.c | 6 ++++--
    1 file changed, 4 insertions(+), 2 deletions(-)

    diff --git a/drivers/irqchip/irq-mscc-ocelot.c b/drivers/irqchip/irq-mscc-ocelot.c
    index 88143c0..e676ae2 100644
    --- a/drivers/irqchip/irq-mscc-ocelot.c
    +++ b/drivers/irqchip/irq-mscc-ocelot.c
    @@ -73,7 +73,8 @@ static int __init ocelot_irq_init(struct device_node *node,
    &irq_generic_chip_ops, NULL);
    if (!domain) {
    pr_err("%pOFn: unable to add irq domain\n", node);
    - return -ENOMEM;
    + ret = -ENOMEM;
    + goto err_irq_dispose;
    }

    ret = irq_alloc_domain_generic_chips(domain, OCELOT_NR_IRQ, 1,
    @@ -109,9 +110,10 @@ static int __init ocelot_irq_init(struct device_node *node,

    err_gc_free:
    irq_free_generic_chip(gc);
    -
    err_domain_remove:
    irq_domain_remove(domain);
    +err_irq_dispose:
    + irq_dispose_mapping(parent_irq);

    return ret;
    }
    --
    2.1.0
    \
     
     \ /
      Last update: 2020-07-01 04:18    [W:3.627 / U:0.388 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site