mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-26 19:00:25 +00:00
[media] s5k5baf: Fix potential NULL pointer dereferencing
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>
This commit is contained in:
parent
7296e158b5
commit
c0ee62734e
1 changed files with 3 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue