Re: [PATCH] Char: virtio_console, fix memory leak

From: Rusty Russell
Date: Sun Nov 07 2010 - 18:28:34 EST


On Sat, 6 Nov 2010 07:36:50 pm Jiri Slaby wrote:
> Stanse found that in init_vqs, memory is leaked under certain
> circumstanses (the fail path order is incorrect). Fix that by checking
> allocations in one turn and free all of them at once if some fails
> (some may be NULL, but this is OK).

Good catch, thanks!

I generally prefer the static rather than lazy method of cleanup, but
in this case it's ugly both before and after...

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