OSDN Git Service

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

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