Commit 35060a22 authored by Colin Ian King's avatar Colin Ian King Committed by Greg Kroah-Hartman

staging: vc04_services: fix NULL pointer dereference on pointer 'service'

Currently, if pservice is null then service is set to NULL and immediately
afterwards service is dereferenced causing a null pointer dereference. Fix
this by bailing out early of the function with a null return.

Detected by CoverityScan, CID#1419681 ("Explicit null dereferenced")
Signed-off-by: default avatarColin Ian King <colin.king@canonical.com>
Acked-by: default avatarStefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent c6299080
...@@ -2673,7 +2673,7 @@ vchiq_add_service_internal(VCHIQ_STATE_T *state, ...@@ -2673,7 +2673,7 @@ vchiq_add_service_internal(VCHIQ_STATE_T *state,
if (!pservice) { if (!pservice) {
kfree(service); kfree(service);
service = NULL; return NULL;
} }
service_quota = &state->service_quotas[service->localport]; service_quota = &state->service_quotas[service->localport];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment