Commit 55f22911 authored by Phong Tran's avatar Phong Tran Committed by Greg Kroah-Hartman

greybus: uart: Fix the memory leak in connection init

If alloc minor is error, gb_tty should free.
Signed-off-by: default avatarPhong Tran <tranmanphong@gmail.com>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent 3cb494cd
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment