projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7296e15
)
[media] s5k5baf: Fix potential NULL pointer dereferencing
author
Sachin Kamat
<sachin.kamat@linaro.org>
Tue, 24 Dec 2013 11:42:05 +0000
(08:42 -0300)
committer
Mauro Carvalho Chehab
<m.chehab@samsung.com>
Tue, 7 Jan 2014 10:48:46 +0000
(08:48 -0200)
Dereference 'fw' after the NULL check.
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
drivers/media/i2c/s5k5baf.c
patch
|
blob
|
history
diff --git
a/drivers/media/i2c/s5k5baf.c
b/drivers/media/i2c/s5k5baf.c
index 974b865c2ee1cba15041dce0f49fa7d38ad03e2e..4b8381111cbd2e66ef2cccc4be64c1e45106d161 100644
(file)
--- a/
drivers/media/i2c/s5k5baf.c
+++ b/
drivers/media/i2c/s5k5baf.c
@@
-548,12
+548,14
@@
static void s5k5baf_synchronize(struct s5k5baf *state, int timeout, u16 addr)
static u16 *s5k5baf_fw_get_seq(struct s5k5baf *state, u16 seq_id)
{
struct s5k5baf_fw *fw = state->fw;
- u16 *data
= fw->data + 2 * fw->count
;
+ u16 *data;
int i;
if (fw == NULL)
return NULL;
+ data = fw->data + 2 * fw->count;
+
for (i = 0; i < fw->count; ++i) {
if (fw->seq[i].id == seq_id)
return data + fw->seq[i].offset;