From: Sjoerd Simons Date: Sun, 16 Feb 2020 21:36:24 +0000 (+0100) Subject: um: vector: Avoid NULL ptr deference if transport is unset X-Git-Tag: v5.7-rc1~62^2~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=237ce2e681d20e92fe17fc23a348b4f0d595e641;p=thirdparty%2Flinux.git 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: Sjoerd Simons Acked-By: Anton Ivanov Signed-off-by: Richard Weinberger --- diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c index 9693dfca76513..8e8aac1d30e13 100644 --- a/arch/um/drivers/vector_kern.c +++ b/arch/um/drivers/vector_kern.c @@ -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) {