Commit 237ce2e6 authored by Sjoerd Simons's avatar Sjoerd Simons Committed by Richard Weinberger

um: vector: Avoid NULL ptr deference if transport is unset

When the transport option of a vec isn't set strncmp ends up being
called on a NULL pointer. Better not do that.
Signed-off-by: default avatarSjoerd Simons <sjoerd.simons@collabora.co.uk>
Acked-By: default avatarAnton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: default avatarRichard Weinberger <richard@nod.at>
parent 33631793
......@@ -197,6 +197,9 @@ static int get_transport_options(struct arglist *def)
long parsed;
int result = 0;
if (transport == NULL)
return -EINVAL;
if (vector != NULL) {
if (kstrtoul(vector, 10, &parsed) == 0) {
if (parsed == 0) {
......
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