WSL2-Linux-Kernel/drivers/media/radio
Luke Nowakowski-Krijger c666355e60 media: radio-raremono: change devm_k*alloc to k*alloc
Change devm_k*alloc to k*alloc to manually allocate memory

The manual allocation and freeing of memory is necessary because when
the USB radio is disconnected, the memory associated with devm_k*alloc
is freed. Meaning if we still have unresolved references to the radio
device, then we get use-after-free errors.

This patch fixes this by manually allocating memory, and freeing it in
the v4l2.release callback that gets called when the last radio device
exits.

Reported-and-tested-by: syzbot+a4387f5b6b799f6becbf@syzkaller.appspotmail.com

Signed-off-by: Luke Nowakowski-Krijger <lnowakow@eng.ucsd.edu>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
[hverkuil-cisco@xs4all.nl: cleaned up two small checkpatch.pl warnings]
[hverkuil-cisco@xs4all.nl: prefix subject with driver name]
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-06-27 07:35:24 -04:00
..
si470x Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
si4713 Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
wl128x Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
Kconfig Linux 5.2-rc2 2019-05-28 11:21:51 -04:00
Makefile media: remove unneeded header search paths 2019-05-18 11:49:56 +09:00
dsbr100.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
lm7000.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
radio-aimslab.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-aztech.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-cadet.c media: media/radio: set device_caps in struct video_device 2019-06-05 08:19:12 -04:00
radio-gemtek.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-isa.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-isa.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
radio-keene.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-ma901.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-maxiradio.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-miropcm20.c media: media/radio: set device_caps in struct video_device 2019-06-05 08:19:12 -04:00
radio-mr800.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-raremono.c media: radio-raremono: change devm_k*alloc to k*alloc 2019-06-27 07:35:24 -04:00
radio-rtrack2.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-sf16fmi.c media: media/radio: set device_caps in struct video_device 2019-06-05 08:19:12 -04:00
radio-sf16fmr2.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-shark.c media: use strscpy() instead of strlcpy() 2018-09-11 13:32:17 -04:00
radio-shark2.c media: use strscpy() instead of strlcpy() 2018-09-11 13:32:17 -04:00
radio-si476x.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-tea5764.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-tea5777.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-tea5777.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 2019-05-30 11:26:37 -07:00
radio-terratec.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-timb.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-trust.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-typhoon.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
radio-wl1273.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
radio-zoltrix.c treewide: Add SPDX license identifier for more missed files 2019-05-21 10:50:45 +02:00
saa7706h.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
tea575x.c Linux 5.2-rc4 2019-06-11 12:09:28 -04:00
tef6862.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00