linux/drivers/media/usb/em28xx
Dongliang Mu 22be5a10d0 media: em28xx: fix memory leak in em28xx_init_dev
In the em28xx_init_rev, if em28xx_audio_setup fails, this function fails
to deallocate the media_dev allocated in the em28xx_media_device_init.

Fix this by adding em28xx_unregister_media_device to free media_dev.

BTW, this patch is tested in my local syzkaller instance, and it can
prevent the memory leak from occurring again.

CC: Pavel Skripkin <paskripkin@gmail.com>
Fixes: 37ecc7b127 ("[media] em28xx: add media controller support")
Signed-off-by: Dongliang Mu <mudongliangabcd@gmail.com>
Reported-by: syzkaller <syzkaller@googlegroups.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-11-15 08:12:02 +00:00
..
em28xx-audio.c media: em28xx-audio: use semicolons rather than commas to separate statements 2020-11-16 10:31:06 +01:00
em28xx-camera.c MAINTAINERS & files: Canonize the e-mails I use at files 2018-05-04 06:21:06 -04:00
em28xx-cards.c media: em28xx: fix memory leak in em28xx_init_dev 2021-11-15 08:12:02 +00:00
em28xx-core.c media: em28xx: Don't use ops->suspend if it is NULL 2021-10-05 09:38:18 +02:00
em28xx-dvb.c media: em28xx: fix memory leak 2021-04-06 10:36:58 +02:00
em28xx-i2c.c media: em28xx-core: Fix i2c error debug 2021-02-05 23:39:04 +01:00
em28xx-input.c media: em28xx-input: fix refcount bug in em28xx_usb_disconnect 2021-08-04 14:43:49 +02:00
em28xx-reg.h media: usb: fix several typos 2019-03-01 09:43:27 -05:00
em28xx-v4l.h media: update/fix my e-mail on some places 2018-05-10 07:27:15 -04:00
em28xx-vbi.c
em28xx-video.c media: media/usb: rename VFL_TYPE_GRABBER to _VIDEO 2020-02-24 16:53:16 +01:00
em28xx.h media: em28xx/em28xx.h: Remove duplicate struct declaration 2021-04-06 16:11:54 +02:00
Kconfig media: em28xx: Add support for Hauppauge USB QuadHD 2021-02-05 23:40:15 +01:00
Makefile media: prefix header search paths with $(srctree)/ 2019-05-18 11:49:56 +09:00