]> git.baikalelectronics.ru Git - kernel.git/commit
Char: virtio_console, fix memory leak
authorJiri Slaby <jslaby@suse.cz>
Sat, 6 Nov 2010 09:06:50 +0000 (10:06 +0100)
committerRusty Russell <rusty@rustcorp.com.au>
Wed, 24 Nov 2010 04:51:12 +0000 (15:21 +1030)
commit2faa94b8213f52e22606135a042523b5092cd2c7
tree2202ed81de7b2afd7f1ce568fc0222497e464de2
parent08394d2efb0dc89c6667f021884b8c784e1c1979
Char: virtio_console, fix memory leak

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).

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Amit Shah <amit.shah@redhat.com>
Cc: virtualization@lists.linux-foundation.org
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
drivers/char/virtio_console.c