Skip to content

Commit

Permalink
um: vector: Avoid NULL ptr deference if transport is unset
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-By: Anton Ivanov <[email protected]>
Signed-off-by: Richard Weinberger <[email protected]>
  • Loading branch information
sjoerdsimons authored and richardweinberger committed Mar 29, 2020
1 parent 3363179 commit 237ce2e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/um/drivers/vector_kern.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 237ce2e

Please sign in to comment.