2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-28 07:04:00 +08:00
linux-next/drivers/media
Luca Ceresoli 438ac1fd5e media: imx274: initialize format before v4l2 controls
The current probe function calls v4l2_ctrl_handler_setup() before
initializing the format info. This triggers call paths such as:
imx274_probe -> v4l2_ctrl_handler_setup -> imx274_s_ctrl ->
imx274_set_exposure, where priv->mode_index is accessed before being
assigned.

This is wrong but does not trigger a visible bug because priv is
zero-initialized and 0 is the default value for priv->mode_index. But
this would become a crash in follow-up commits when mode_index is
replaced by a pointer that must always be valid.

Fix the bug before it shows up by initializing struct members early.

Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04 07:23:54 -04:00
..
cec media: cec: fix wrong tx/rx_status values when canceling a msg 2018-05-28 16:25:25 -04:00
common treewide: Use array_size() in vzalloc() 2018-06-12 16:19:22 -07:00
dvb-core docs: Fix some broken references 2018-06-15 18:10:01 -03:00
dvb-frontends media: dvb: point to the location of the old README.dvb-usb file 2018-06-15 18:10:01 -03:00
firewire vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00
i2c media: imx274: initialize format before v4l2 controls 2018-07-04 07:23:54 -04:00
mmc media: siano: use GFP_DMA only for smssdio 2018-05-15 08:04:42 -04:00
pci media: cx88: add error handling for snd_ctl_add 2018-06-28 07:54:27 -04:00
platform media: s3c-camif: ignore -ENOIOCTLCMD from v4l2_subdev_call for s_power 2018-06-28 09:22:30 -04:00
radio media: v4l: fix broken video4linux docs locations 2018-06-15 18:10:01 -03:00
rc ARM: SoC platform updates 2018-06-11 17:49:09 -07:00
spi media: cxd2880-spi: Modified how to declare structure 2018-05-05 10:37:12 -04:00
tuners Linux 4.17-rc4 2018-05-10 07:19:23 -04:00
usb media: tm6000: add error handling for dvb_register_adapter 2018-06-28 07:54:49 -04:00
v4l2-core media: mem2mem: Remove excessive try_run call 2018-06-28 07:53:44 -04:00
Kconfig media: cec: Kconfig coding style issue 2018-05-09 16:26:50 -04:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
media-device.c media: media.h: remove __NEED_MEDIA_LEGACY_API 2018-06-28 08:10:51 -04:00
media-devnode.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
media-entity.c media: media.h: reorganize header to make it easier to understand 2018-02-26 10:14:46 -05:00