mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-11 07:03:09 -04:00
greybus: uart: Fix the memory leak in connection init
If alloc minor is error, gb_tty should free. Signed-off-by: Phong Tran <tranmanphong@gmail.com> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
3cb494cd6c
commit
55f2291142
1 changed files with 4 additions and 2 deletions
|
|
@ -618,9 +618,11 @@ static int gb_uart_connection_init(struct gb_connection *connection)
|
|||
if (minor == -ENOSPC) {
|
||||
dev_err(&connection->dev,
|
||||
"no more free minor numbers\n");
|
||||
return -ENODEV;
|
||||
retval = -ENODEV;
|
||||
goto error_version;
|
||||
}
|
||||
return minor;
|
||||
retval = minor;
|
||||
goto error_version;
|
||||
}
|
||||
|
||||
gb_tty->minor = minor;
|
||||
|
|
|
|||
Loading…
Reference in a new issue