Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1604623 > unrolled thread
| Started by | Colin King <colin.king@canonical.com> |
|---|---|
| First post | 2017-03-20 15:30 +0100 |
| Last post | 2017-03-20 15:50 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] staging: vc04_services: fix NULL pointer dereference on pointer 'service' Colin King <colin.king@canonical.com> - 2017-03-20 15:30 +0100
Re: [PATCH] staging: vc04_services: fix NULL pointer dereference on pointer 'service' Stefan Wahren <stefan.wahren@i2se.com> - 2017-03-20 15:50 +0100
| From | Colin King <colin.king@canonical.com> |
|---|---|
| Date | 2017-03-20 15:30 +0100 |
| Subject | [PATCH] staging: vc04_services: fix NULL pointer dereference on pointer 'service' |
| Message-ID | <tn6tP-5Wi-1@gated-at.bofh.it> |
From: Colin Ian King <colin.king@canonical.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@canonical.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
[toc] | [next] | [standalone]
| From | Stefan Wahren <stefan.wahren@i2se.com> |
|---|---|
| Date | 2017-03-20 15:50 +0100 |
| Subject | Re: [PATCH] staging: vc04_services: fix NULL pointer dereference on pointer 'service' |
| Message-ID | <tn6Nb-67a-9@gated-at.bofh.it> |
| In reply to | #1604623 |
[add Mauro to CC]
Am 20.03.2017 um 15:08 schrieb Colin King:
> From: Colin Ian King <colin.king@canonical.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@canonical.com>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web