[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CALYGNiPMAPRgYLe18bePGvXuWCcGf+wCeJGW9QABCjCwXmNSEg@mail.gmail.com>
Date: Mon, 13 Jul 2015 12:43:17 +0300
From: Konstantin Khlebnikov <koct9i@...il.com>
To: "Luck, Tony" <tony.luck@...el.com>
Cc: Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
"linux-acpi@...r.kernel.org" <linux-acpi@...r.kernel.org>,
"Chen, Gong" <gong.chen@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Tomasz Nowicki <tomasz.nowicki@...aro.org>
Subject: Re: [PATCH] acpi/apei: free lists of resources in einj and erst
On Fri, Jul 10, 2015 at 9:14 PM, Luck, Tony <tony.luck@...el.com> wrote:
> --- a/drivers/acpi/apei/einj.c
> +++ b/drivers/acpi/apei/einj.c
> @@ -379,10 +379,9 @@ static int __einj_error_trigger(u64 trigger_paddr, u32 type,
> rc = apei_resources_add(&addr_resources,
> trigger_param_region->address,
> trigger_param_region->bit_width/8, true);
> - if (rc)
> - goto out_fini;
> - rc = apei_resources_sub(&trigger_resources,
> - &addr_resources);
> + if (!rc)
> + rc = apei_resources_sub(&trigger_resources,
> + &addr_resources);
> }
> apei_resources_fini(&addr_resources);
> if (rc)
>
> This bit looks wrong ... the line right after the this diff ends is
> goto out_fini;
>
> so we'll call apei_resources_fini() twice in the rc!=0 case.
As I see it frees different struct apei_resources: here addr_resources and
trigger_resources at the out_fini.
Anyway calling apei_resources_fini twice is safe: it removes and frees ranges
from lists. If these lists are empty apei_resources_fini does nothing.
>
> -Tony
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists