Skip to content

Commit 237ce2e

Browse files
sjoerdsimonsrichardweinberger
authored andcommitted
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 <[email protected]> Acked-By: Anton Ivanov <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 3363179 commit 237ce2e

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/um/drivers/vector_kern.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,9 @@ static int get_transport_options(struct arglist *def)
197197
long parsed;
198198
int result = 0;
199199

200+
if (transport == NULL)
201+
return -EINVAL;
202+
200203
if (vector != NULL) {
201204
if (kstrtoul(vector, 10, &parsed) == 0) {
202205
if (parsed == 0) {

0 commit comments

Comments
 (0)