From: Michael Grzeschik Date: Tue, 27 Nov 2018 10:02:49 +0000 (-0500) Subject: media: mt9m111: add streaming check to set_fmt X-Git-Tag: v5.0-rc1~182^2~68 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=3c437901bd83d236e4349d93bf5d3d814b8f6357;p=linux.git 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: Michael Grzeschik Signed-off-by: Marco Felsch Reviewed-by: Philipp Zabel Signed-off-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/i2c/mt9m111.c b/drivers/media/i2c/mt9m111.c index 03559669de9f..9b0a3689fa98 100644 --- a/drivers/media/i2c/mt9m111.c +++ b/drivers/media/i2c/mt9m111.c @@ -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;