linux/drivers/media/platform
Kefeng Wang 2455d417c0 media: vim2m: Fix BUG_ON in vim2m_device_release()
If v4l2_m2m_init() fails, m2m_dev pointer will be set ERR_PTR(-ENOMEM),
then kfree m2m_dev will trigger BUG_ON, see below, fix it by setting m2m_dev
to NULL.

  vim2m vim2m.0: Failed to init mem2mem device
  ------------[ cut here ]------------
  kernel BUG at mm/slub.c:3944!
  invalid opcode: 0000 [#1] SMP PTI
  CPU: 11 PID: 9061 Comm: insmod Tainted: G            E     5.2.0-rc2 #81
  Hardware name: Red Hat KVM, BIOS 0.5.1 01/01/2011
  RIP: 0010:kfree+0x11a/0x160

  Call Trace:
   vim2m_device_release+0x3f/0x50 [vim2m]
   device_release+0x27/0x80
   kobject_release+0x68/0x190
   vim2m_probe+0x20f/0x280 [vim2m]
   platform_drv_probe+0x37/0x90
   really_probe+0xef/0x3d0
   driver_probe_device+0x110/0x120
   device_driver_attach+0x4f/0x60
   __driver_attach+0x9a/0x140
   ? device_driver_attach+0x60/0x60
   bus_for_each_dev+0x76/0xc0
   ? klist_add_tail+0x57/0x70
   bus_add_driver+0x141/0x210
   driver_register+0x5b/0xe0
   vim2m_init+0x29/0x1000 [vim2m]
   do_one_initcall+0x46/0x1f4
   ? __slab_alloc+0x1c/0x30
   ? kmem_cache_alloc_trace+0x167/0x1b0
   do_init_module+0x5b/0x21f
   load_module+0x1add/0x1fb0
   ? __do_sys_finit_module+0xe9/0x110
   __do_sys_finit_module+0xe9/0x110
   do_syscall_64+0x5b/0x1c0
   entry_SYSCALL_64_after_hwframe+0x44/0xa9

Fixes: ea6c7e34f3 ("media: vim2m: replace devm_kzalloc by kzalloc")
Reported-by: Hulk Robot <hulkci@huawei.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-10-01 16:52:52 -03:00
..
am437x media: am437x-vpfe: Switch to SPDX Licensing 2019-10-01 16:15:38 -03:00
atmel media: atmel: atmel-isi: fix timeout value for stop streaming 2019-08-23 07:27:55 -03:00
cadence media: Add support for Cadence CSI2TX 2.1 2019-07-25 06:44:17 -04:00
cec-gpio Linux 5.2-rc2 2019-05-28 11:21:51 -04:00
coda media: coda: set device_caps in struct video_device 2019-07-22 14:45:10 -04:00
cros-ec-cec chrome platform changes for v5.4 2019-09-19 14:14:28 -07:00
davinci media: use the BIT() macro 2019-08-26 14:08:50 -03:00
exynos-gsc media: media/platform: don't set description in ENUM_FMT 2019-07-22 14:43:59 -04:00
exynos4-is media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
marvell-ccic media: marvell-ccic: mmp: add MODULE_DEVICE_TABLE 2019-07-25 06:27:14 -04:00
meson media: platform: meson-ao-cec-g12a: add support for SM1 2019-07-23 08:51:50 -04:00
mtk-jpeg media: mtk-jpeg: Use vb2_get_buffer 2019-06-21 16:22:02 -04:00
mtk-mdp media: platform: mtk-mdp: mtk_mdp_core: Add of_node_put() before goto 2019-08-13 11:49:46 -03:00
mtk-vcodec media: mtk-vcodec: vdec: clean up vidioc_vdec_s_fmt a bit 2019-10-01 16:46:42 -03:00
mtk-vpu Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
omap media updates for v5.4-rc1 2019-09-17 17:55:23 -07:00
omap3isp media: use the BIT() macro 2019-08-26 14:08:50 -03:00
qcom media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
rcar-vin media: rcar-vin: Report correct image stride 2019-08-13 11:39:02 -03:00
rockchip/rga media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
s3c-camif media: s3c-camif: make array 'registers' static const, makes object smaller 2019-10-01 16:43:49 -03:00
s5p-cec media: s5p-cec: use cec_notifier_cec_adap_(un)register 2019-07-23 08:39:27 -04:00
s5p-g2d media: s3c-camif/s5p-g2d/s5p-jpeg: set device_caps in struct video_device 2019-07-22 14:45:40 -04:00
s5p-jpeg media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
s5p-mfc media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
seco-cec media: seco-cec: Add a missing 'release_region()' in an error handling path 2019-10-01 16:41:21 -03:00
sti media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
stm32 media: stm32-dcmi: Delete an unnecessary of_node_put() call in dcmi_probe() 2019-08-29 10:23:02 -03:00
sunxi media: sun4i: Make sun4i_csi_formats static 2019-08-30 14:44:17 -03:00
tegra-cec media: use the BIT() macro 2019-08-26 14:08:50 -03:00
ti-vpe media: use the BIT() macro 2019-08-26 14:08:50 -03:00
vicodec media: vicodec: make life easier for static analyzers 2019-08-26 14:02:22 -03:00
vimc media: vimc: move duplicated IS_SRC and IS_SINK to common header 2019-10-01 12:38:01 -03:00
vivid Linux 5.3-rc4 2019-08-12 13:22:54 -03:00
vsp1 media: use the BIT() macro 2019-08-26 14:08:50 -03:00
xilinx media: use the BIT() macro 2019-08-26 14:08:50 -03:00
Kconfig chrome platform changes for v5.4 2019-09-19 14:14:28 -07:00
Makefile media: sunxi: Refactor the Makefile and Kconfig 2019-08-23 07:29:05 -03:00
aspeed-video.c media: aspeed-video: address a protential usage of an unitialized var 2019-08-26 14:03:39 -03:00
fsl-viu.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
imx-pxp.c media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
imx-pxp.h media: imx-pxp: add i.MX Pixel Pipeline driver 2018-09-11 13:32:17 -04:00
m2m-deinterlace.c media: m2m-deinterlace: use struct v4l2_fh 2019-07-23 11:49:41 -04:00
mx2_emmaprp.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
pxa_camera.c media: don't do a 31 bit shift on a signed int 2019-08-26 14:11:10 -03:00
rcar-fcp.c Char/Misc driver patches for 4.19-rc1 2018-08-18 11:04:51 -07:00
rcar_drif.c media: rcar_drif: Remove devm_ioremap_resource() error printing 2019-03-19 13:44:38 -04:00
rcar_fdp1.c media: fdp1: Fix a memory leak bug 2019-08-26 10:41:17 -03:00
rcar_jpu.c media: v4l2: Get rid of ->vidioc_enum_fmt_vid_{cap, out}_mplane 2019-06-05 07:48:32 -04:00
renesas-ceu.c media: Remove dev_err() usage after platform_get_irq() 2019-08-07 17:08:33 -03:00
sh_veu.c media: sh_veu: convert to struct v4l2_fh 2019-07-25 06:29:26 -04:00
sh_vou.c media: sh_veu/sh_vou: set device_caps in struct video_device 2019-07-22 15:09:06 -04:00
via-camera.c media: via-camera: convert to the vb2 framework 2019-07-30 12:18:34 -04:00
via-camera.h media: fix usage of whitespaces and on indentation 2018-01-04 13:12:01 -05:00
video-mux.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
vim2m.c media: vim2m: Fix BUG_ON in vim2m_device_release() 2019-10-01 16:52:52 -03:00