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
|
@ -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 New Issue