Commit e2c073c7 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab
Browse files

media: imx: capture: Handle errors from v4l2_fh_open()



If the call to v4l2_fh_open() fails, return the error code instead of
proceeding normally as if nothing happened.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarRui Miguel Silva <rmfrfs@gmail.com>
Reviewed-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 5722a174
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -643,13 +643,16 @@ static int capture_open(struct file *file)
		return -ERESTARTSYS;

	ret = v4l2_fh_open(file);
	if (ret)
	if (ret) {
		dev_err(priv->dev, "v4l2_fh_open failed\n");
		goto out;
	}

	ret = v4l2_pipeline_pm_get(&vfd->entity);
	if (ret)
		v4l2_fh_release(file);

out:
	mutex_unlock(&priv->mutex);
	return ret;
}