]> 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)
commite6e8fa063968eea1215b78b0464b2ecc65014d5b
tree5506ecd6495afa55b912145211ac650f3036a61c
parent40e809b89fd9798ae01a7db903269f5301b0ba0c
[media] pctv452e: move buffer to heap, no mutex

commit cbe6c2715e4f ("[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 cbe6c2715e4f ("[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