Commit 3c437901 authored by Michael Grzeschik's avatar Michael Grzeschik Committed by Mauro Carvalho Chehab
Browse files

media: mt9m111: add streaming check to set_fmt



Currently set_fmt don't care about the streaming status, so the format
can be changed during streaming. This can lead into wrong behaviours.

Check if the device is already streaming and return -EBUSY to avoid
wrong behaviours.

Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: default avatarMarco Felsch <m.felsch@pengutronix.de>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 7784b1d2
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -563,6 +563,9 @@ static int mt9m111_set_fmt(struct v4l2_subdev *sd,
	bool bayer;
	int ret;

	if (mt9m111->is_streaming)
		return -EBUSY;

	if (format->pad)
		return -EINVAL;