]> rtime.felk.cvut.cz Git - vajnamar/linux-xlnx.git/commitdiff
imx274: Fix error handling xilinx-v2017.4
authorSakari Ailus <sakari.ailus@linux.intel.com>
Thu, 2 Nov 2017 03:22:30 +0000 (20:22 -0700)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 20 Nov 2017 07:10:35 +0000 (08:10 +0100)
Fix error handling in driver probe and unregister the correct control handler
in driver remove.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Christian Kohn <christian.kohn@xilinx.com>
Reviewed-by: Vishal Sagar <vishal.sagar@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/i2c/imx274.c

index ab6a5f31da7429eb17bf8225678e0b8270c57b00..737dbf59a0d2a6fdfd42a7f46444d6c9a16cb356 100644 (file)
@@ -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:
@@ -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;