summaryrefslogtreecommitdiff
path: root/arch/um/drivers
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd.simons@collabora.co.uk>2020-02-17 00:36:24 +0300
committerRichard Weinberger <richard@nod.at>2020-03-30 00:54:51 +0300
commit237ce2e681d20e92fe17fc23a348b4f0d595e641 (patch)
tree6696bd9c027e803eea0196cfb96d51c7d965e85f /arch/um/drivers
parent3363179385629c1804ea846f4e72608c2201a81e (diff)
downloadlinux-237ce2e681d20e92fe17fc23a348b4f0d595e641.tar.xz
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 <sjoerd.simons@collabora.co.uk> Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com> Signed-off-by: Richard Weinberger <richard@nod.at>
Diffstat (limited to 'arch/um/drivers')
-rw-r--r--arch/um/drivers/vector_kern.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/arch/um/drivers/vector_kern.c b/arch/um/drivers/vector_kern.c
index 9693dfca7651..8e8aac1d30e1 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) {