OSDN Git Service

media: max9286: Free control handler
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 14 Jan 2023 21:46:50 +0000 (22:46 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 20 Mar 2023 15:09:38 +0000 (16:09 +0100)
The control handler is leaked in some probe-time error paths, as well as
in the remove path. Fix it.

Fixes: 66d8c9d2422d ("media: i2c: Add MAX9286 driver")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/i2c/max9286.c

index 701038d..13a986b 100644 (file)
@@ -1122,6 +1122,7 @@ err_async:
 static void max9286_v4l2_unregister(struct max9286_priv *priv)
 {
        fwnode_handle_put(priv->sd.fwnode);
+       v4l2_ctrl_handler_free(&priv->ctrls);
        v4l2_async_unregister_subdev(&priv->sd);
        max9286_v4l2_notifier_unregister(priv);
 }