Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] s5p-mfc: Fix NULL pointer dereference caused by not set q->lock

The patch "media: s5p-mfc: use vb2_ops_wait_prepare/finish helper"
(654a731be1a0b6f606f3f3d12b50db08f2ae3c3) introduced a kernel panic.
The q->lock was set for just one queue, the other was not set thus causing
a NULL pointer dereference.

Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>

authored by

Kamil Debski and committed by
Mauro Carvalho Chehab
41f03a00 f7cbd688

+1
+1
drivers/media/platform/s5p-mfc/s5p_mfc.c
··· 833 833 q->type = V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE; 834 834 q->io_modes = VB2_MMAP; 835 835 q->drv_priv = &ctx->fh; 836 + q->lock = &dev->mfc_mutex; 836 837 if (vdev == dev->vfd_dec) { 837 838 q->io_modes = VB2_MMAP; 838 839 q->ops = get_dec_queue_ops();