]> git.baikalelectronics.ru Git - kernel.git/commit
[media] pctv452e: move buffer to heap, no mutex
authorMax Kellermann <max.kellermann@gmail.com>
Thu, 15 Dec 2016 21:51:07 +0000 (19:51 -0200)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 21 Dec 2016 09:15:36 +0000 (07:15 -0200)
commit7d457f44320069924924e504a24f5174049d4af0
tree5506ecd6495afa55b912145211ac650f3036a61c
parent226bae2659c384d22acbbf20d7e98033c3bef51b
[media] pctv452e: move buffer to heap, no mutex

commit 64d00abb3f4b ("[media] pctv452e: don't do DMA on stack") caused
a NULL pointer dereference which occurs when dvb_usb_init()
calls dvb_usb_device_power_ctrl() for the first time, before the
frontend has been attached. It also caused a recursive deadlock because
tt3650_ci_msg_locked() has already locked the mutex.

So, partially revert it, but move the buffer to the heap
(DMA capable), not to the stack (may not be DMA capable).
Instead of sharing one buffer which needs mutex protection,
do a new heap allocation for each call.

Fixes: commit 64d00abb3f4b ("[media] pctv452e: don't do DMA on stack")
Cc: stable@vger.kernel.org # For Kernel 4.9
Signed-off-by: Max Kellermann <max.kellermann@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/usb/dvb-usb/pctv452e.c