2015-12-17 09:29:22 +00:00
|
|
|
From e9b089f99bf763bf803f82201cbb35251b6d8945 Mon Sep 17 00:00:00 2001
|
2015-10-26 09:01:05 +00:00
|
|
|
From: Colin Ian King <colin.king@canonical.com>
|
|
|
|
Date: Wed, 2 Sep 2015 07:33:39 -0400
|
2015-12-17 09:29:22 +00:00
|
|
|
Subject: [PATCH 174/222] bcm2835: camera: check for scene not being found
|
2015-10-26 09:01:05 +00:00
|
|
|
|
|
|
|
static analysis by cppcheck detected some potential NULL pointer
|
|
|
|
dereference issues:
|
|
|
|
|
|
|
|
[drivers/media/platform/bcm2835/controls.c:854]: (error) Possible null
|
|
|
|
pointer dereference: scene
|
|
|
|
(and lines 858, 859 too)
|
|
|
|
|
|
|
|
it is possible that scene is not found because of an invalue ctrl->val
|
|
|
|
and is therefore NULL and hence causing a null pointer dereference.
|
|
|
|
|
|
|
|
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
|
|
|
---
|
|
|
|
drivers/media/platform/bcm2835/controls.c | 2 ++
|
|
|
|
1 file changed, 2 insertions(+)
|
|
|
|
|
|
|
|
--- a/drivers/media/platform/bcm2835/controls.c
|
|
|
|
+++ b/drivers/media/platform/bcm2835/controls.c
|
|
|
|
@@ -845,6 +845,8 @@ static int ctrl_set_scene_mode(struct bm
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
+ if (!scene)
|
|
|
|
+ return -EINVAL;
|
|
|
|
if (i >= ARRAY_SIZE(scene_configs))
|
|
|
|
return -EINVAL;
|
|
|
|
|