mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 09:19:51 +00:00
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>
This commit is contained in:
parent
3363179385
commit
237ce2e681
1 changed files with 3 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue