[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170320140850.10570-1-colin.king@canonical.com>
Date: Mon, 20 Mar 2017 14:08:50 +0000
From: Colin King <colin.king@...onical.com>
To: Lee Jones <lee@...nel.org>, Eric Anholt <eric@...olt.net>,
Stefan Wahren <stefan.wahren@...e.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Michael Zoran <mzoran@...wfest.net>,
Narcisa Ana Maria Vasile <narcisaanamaria12@...il.com>,
Phil Elwell <phil@...pberrypi.org>,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org, devel@...verdev.osuosl.org
Cc: kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] staging: vc04_services: fix NULL pointer dereference on pointer 'service'
From: Colin Ian King <colin.king@...onical.com>
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@...onical.com>
---
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index dc9f85c2a5da..4f9e738abddf 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -2673,7 +2673,7 @@ vchiq_add_service_internal(VCHIQ_STATE_T *state,
if (!pservice) {
kfree(service);
- service = NULL;
+ return NULL;
}
service_quota = &state->service_quotas[service->localport];
--
2.11.0
Powered by blists - more mailing lists