[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.DEB.2.00.1210161214001.4770@chino.kir.corp.google.com>
Date: Tue, 16 Oct 2012 12:14:16 -0700 (PDT)
From: David Rientjes <rientjes@...gle.com>
To: Jesper Juhl <jj@...osbits.net>
cc: linux-acpi@...r.kernel.org, linux-kernel@...r.kernel.org,
Len Brown <lenb@...nel.org>
Subject: Re: [PATCH] [resend] ACPI: Fix memory leak in acpi_bind_one()
(fwd)
On Mon, 15 Oct 2012, Jesper Juhl wrote:
> Memory is allocated with kzalloc() and assigned to
> 'physical_node'. Then 'physical_node->node_id' is initialized with a
> call to 'find_first_zero_bit()', if that results in a value greater
> than ACPI_MAX_PHYSICAL_NODE we'll end up jumping to the 'err:' label
> and there leave the function and let 'physical_node' go out of scope
> and leak the memory we allocated.
> This patch fixes the leak by simply freeing the unused/unneeded memory
> pointed to by 'physical_node' just before we jump to 'err:'.
>
> Signed-off-by: Jesper Juhl <jj@...osbits.net>
Acked-by: David Rientjes <rientjes@...gle.com>
--
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