Skip to content

Commit

Permalink
imx274: Fix error handling
Browse files Browse the repository at this point in the history
Fix error handling in driver probe and unregister the correct control handler
in driver remove.

Signed-off-by: Sakari Ailus <[email protected]>
Signed-off-by: Christian Kohn <[email protected]>
Reviewed-by: Vishal Sagar <[email protected]>
Signed-off-by: Michal Simek <[email protected]>
  • Loading branch information
Sakari Ailus authored and Michal Simek committed Nov 20, 2017
1 parent bd8f87c commit b450e90
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/media/i2c/imx274.c
Original file line number Diff line number Diff line change
Expand Up @@ -1770,8 +1770,7 @@ static int imx274_probe(struct i2c_client *client,
return 0;

err_ctrls:
v4l2_async_unregister_subdev(sd);
v4l2_ctrl_handler_free(sd->ctrl_handler);
v4l2_ctrl_handler_free(&imx274->ctrls.handler);
err_me:
media_entity_cleanup(&sd->entity);
err_regmap:
Expand All @@ -1788,7 +1787,7 @@ static int imx274_remove(struct i2c_client *client)
imx274_write_table(imx274, mode_table[IMX274_MODE_STOP_STREAM]);

v4l2_async_unregister_subdev(sd);
v4l2_ctrl_handler_free(sd->ctrl_handler);
v4l2_ctrl_handler_free(&imx274->ctrls.handler);
media_entity_cleanup(&sd->entity);
mutex_destroy(&imx274->lock);
return 0;
Expand Down

0 comments on commit b450e90

Please sign in to comment.