From b6ae906b04113cb73c1ffe9c42fbcdcb074d9f07 Mon Sep 17 00:00:00 2001
From: Pawel Osciak
Date: Tue, 22 Jun 2010 05:38:41 -0300
Subject: [PATCH] V4L/DVB: v4l: mem2mem_testdev: fix g_fmt NULL pointer
dereference
MIME-Version: 1.0
Content-Type: text/plain; charset=utf8
Content-Transfer-Encoding: 8bit
Calling g_fmt before s_fmt resulted in a NULL pointer dereference as no
default formats were being selected on probe.
Reported-by: Németh Márton
Signed-off-by: Pawel Osciak
Signed-off-by: Kyungmin Park
Signed-off-by: Mauro Carvalho Chehab
---
drivers/media/video/mem2mem_testdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/video/mem2mem_testdev.c b/drivers/media/video/mem2mem_testdev.c
index 554eaf140128..10ddeccc70eb 100644
--- a/drivers/media/video/mem2mem_testdev.c
+++ b/drivers/media/video/mem2mem_testdev.c
@@ -988,6 +988,9 @@ static int m2mtest_probe(struct platform_device *pdev)
goto err_m2m;
}
+ q_data[V4L2_M2M_SRC].fmt = &formats[0];
+ q_data[V4L2_M2M_DST].fmt = &formats[0];
+
return 0;
err_m2m:
--
2.39.5