Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1293883

Re: [RFC PATCH V2 5/8] irqchip/gic: Return an error if GIC initialisation fails

From Linus Walleij <linus.walleij@linaro.org>
Newsgroups linux.kernel
Subject Re: [RFC PATCH V2 5/8] irqchip/gic: Return an error if GIC initialisation fails
Date 2015-12-17 14:30 +0100
Message-ID <qGGN3-8nL-1@gated-at.bofh.it> (permalink)
References <qGErU-6H4-11@gated-at.bofh.it> <qGErU-6H4-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Dec 17, 2015 at 11:48 AM, Jon Hunter <jonathanh@nvidia.com> wrote:

> If the GIC initialisation fails, then currently we do not return an error
> or clean-up afterwards. Although for root controllers, this failure may be
> fatal anyway, for secondary controllers, it may not be fatal and so return
> an error on failure and clean-up.
>
> Also for non-banked GIC controllers, make sure that we free any memory
> allocated if we fail to initialise the IRQ domain.
>
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
(...)

Almost perfect but...

> +err:
> +       if (IS_ENABLED(CONFIG_GIC_NON_BANKED) && percpu_offset) {
> +               free_percpu(gic->dist_base.percpu_base);
> +               free_percpu(gic->cpu_base.percpu_base);

What if the first map worked but not the second?

Should it be:

if (gic->dist_base.percpu_base)
   free_percpu(gic->dist_base.percpu_base);
if (gic->cpu_base.percpu_base)
   free_percpu(gic->cpu_base.percpu_base);

?

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[RFC PATCH V2 5/8] irqchip/gic: Return an error if GIC initialisation fails Jon Hunter <jonathanh@nvidia.com> - 2015-12-17 12:00 +0100
  Re: [RFC PATCH V2 5/8] irqchip/gic: Return an error if GIC  initialisation fails Linus Walleij <linus.walleij@linaro.org> - 2015-12-17 14:30 +0100
    Re: [RFC PATCH V2 5/8] irqchip/gic: Return an error if GIC  initialisation fails Jon Hunter <jonathanh@nvidia.com> - 2015-12-18 11:30 +0100

csiph-web