]> git.baikalelectronics.ru Git - kernel.git/commit
media: imx214: don't de-reference a NULL pointer
authorMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Fri, 7 Dec 2018 11:43:03 +0000 (06:43 -0500)
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>
Mon, 25 Mar 2019 18:40:56 +0000 (14:40 -0400)
commitdea4908f62c51f87461d70f6bf29b59ab9a073fb
treeabeedf6bae87ff01953d112621da109f98a28c63
parent643c3726e8b7af39197f208929636ebfd6f98706
media: imx214: don't de-reference a NULL pointer

As warned by smatch:
drivers/media/i2c/imx214.c:591 imx214_set_format() warn: variable dereferenced before check 'format' (see line 589)

It turns that the code at imx214_set_format() has support for being
called with the format being NULL. I've no idea why, as it is only
called internally with the pointer set, and via subdev API (with
should also set it).

Also, the entire logic there depends on having format != NULL, so
just remove the bogus broken support for a null format.

Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Ricardo Ribalda Delgado <ricardo@ribalda.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
drivers/media/i2c/imx214.c