staging: vc04_services: fix NULL pointer dereference on pointer 'service'
authorColin Ian King <colin.king@canonical.com>
Mon, 20 Mar 2017 14:08:50 +0000 (14:08 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 21 Mar 2017 07:36:14 +0000 (08:36 +0100)
commit35060a228e70c712cb626ef3eabaedc40903eb77
treec014727b24d6cb2db5479d4ae87a5ab5240432f2
parentc62990801d3beb7e6182c742832128ef3e2b1100
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: Colin Ian King <colin.king@canonical.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c