From: Pawel Osciak Date: Tue, 22 Jun 2010 08:38:41 +0000 (-0300) Subject: V4L/DVB: v4l: mem2mem_testdev: fix g_fmt NULL pointer dereference X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b6ae906b04113cb73c1ffe9c42fbcdcb074d9f07;p=openwrt%2Fstaging%2Fblogic.git V4L/DVB: v4l: mem2mem_testdev: fix g_fmt NULL pointer dereference 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 --- 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: