um: Fix null pointer dereference in vector_user_bpf
authorGaurav Singh <gaurav1086@gmail.com>
Sun, 14 Jun 2020 01:19:40 +0000 (21:19 -0400)
committerRichard Weinberger <richard@nod.at>
Sun, 11 Oct 2020 21:12:51 +0000 (23:12 +0200)
commitbab991cf40f631d18d00cb8c2a97325c8fd4292e
treee9a621e1d6e042925c4ed29e50a815634d29af2f
parentba4f184e126b751d1bffad5897f263108befc780
um: Fix null pointer dereference in vector_user_bpf

The bpf_prog is being checked for !NULL after uml_kmalloc
but later its used directly for example:
bpf_prog->filter = bpf and is also later returned upon
success. Fix this, do a NULL check and return right away.

Signed-off-by: Gaurav Singh <gaurav1086@gmail.com>
Acked-By: Anton Ivanov <anton.ivanov@cambridgegreys.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
arch/um/drivers/vector_user.c