mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 05:02:12 +00:00
staging: speakup: fix memory leak
speakup_init() didn't free first_console if speakup_kobj_init() fails. Also propagate speakup_kobj_init()'s return code. Signed-off-by: Vasiliy Kulikov <segooon@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
6a56486716
commit
b3495cebaa
@ -2259,8 +2259,11 @@ static int __init speakup_init(void)
|
||||
first_console = kzalloc(sizeof(*first_console), GFP_KERNEL);
|
||||
if (!first_console)
|
||||
return -ENOMEM;
|
||||
if (speakup_kobj_init() < 0)
|
||||
return -ENOMEM;
|
||||
err = speakup_kobj_init();
|
||||
if (err) {
|
||||
kfree(first_console);
|
||||
return err;
|
||||
}
|
||||
|
||||
reset_default_chars();
|
||||
reset_default_chartab();
|
||||
|
Loading…
Reference in New Issue
Block a user