On Tue, May 27, 2014 at 12:46:49AM +0200, Laurent Pinchart wrote:
> Bail out when the SRU control handler fails to initialize.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com>
> ---
>  drivers/media/platform/vsp1/vsp1_sru.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/media/platform/vsp1/vsp1_sru.c 
> b/drivers/media/platform/vsp1/vsp1_sru.c
> index aa0e04c..79efcaf 100644
> --- a/drivers/media/platform/vsp1/vsp1_sru.c
> +++ b/drivers/media/platform/vsp1/vsp1_sru.c
> @@ -348,6 +348,14 @@ struct vsp1_sru *vsp1_sru_create(struct vsp1_device 
> *vsp1)
>       /* Initialize the control handler. */
>       v4l2_ctrl_handler_init(&sru->ctrls, 1);
>       v4l2_ctrl_new_custom(&sru->ctrls, &sru_intensity_control, NULL);
> +
> +     if (sru->ctrls.error) {
> +             dev_err(vsp1->dev, "sru: failed to initialize controls\n");
> +             ret = sru->ctrls.error;
> +             v4l2_ctrl_handler_free(&sru->ctrls);
> +             return ERR_PTR(ret);
> +     }
> +
>       v4l2_ctrl_handler_setup(&sru->ctrls);
>       sru->entity.subdev.ctrl_handler = &sru->ctrls;
>  

Acked-by: Sakari Ailus <sakari.ai...@linux.intel.com>

-- 
Sakari Ailus
e-mail: sakari.ai...@iki.fi     XMPP: sai...@retiisi.org.uk
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to