]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
media: i2c: ds90ub9x3: Fix extra fwnode_handle_put()
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fri, 6 Dec 2024 08:26:37 +0000 (10:26 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 19 Dec 2024 11:50:15 +0000 (12:50 +0100)
The ub913 and ub953 drivers call fwnode_handle_put(priv->sd.fwnode) as
part of their remove process, and if the driver is removed multiple
times, eventually leads to put "overflow", possibly causing memory
corruption or crash.

The fwnode_handle_put() is a leftover from commit 905f88ccebb1 ("media:
i2c: ds90ub9x3: Fix sub-device matching"), which changed the code
related to the sd.fwnode, but missed removing these fwnode_handle_put()
calls.

Cc: stable@vger.kernel.org
Fixes: 905f88ccebb1 ("media: i2c: ds90ub9x3: Fix sub-device matching")
Reviewed-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/i2c/ds90ub913.c
drivers/media/i2c/ds90ub953.c

index 8eed4a200fd89b5af1fc4578cb865bf1408acd76..b5375d7366299662509bc3d76524b839db4c0cdd 100644 (file)
@@ -793,7 +793,6 @@ static void ub913_subdev_uninit(struct ub913_data *priv)
        v4l2_async_unregister_subdev(&priv->sd);
        ub913_v4l2_nf_unregister(priv);
        v4l2_subdev_cleanup(&priv->sd);
-       fwnode_handle_put(priv->sd.fwnode);
        media_entity_cleanup(&priv->sd.entity);
 }
 
index 8b028a84f5bc7fd2af5c95115dcb6a7c1dadc821..ba7bd8809d1608d33a8af17d86aa0f670edb2785 100644 (file)
@@ -1288,7 +1288,6 @@ static void ub953_subdev_uninit(struct ub953_data *priv)
        v4l2_async_unregister_subdev(&priv->sd);
        ub953_v4l2_notifier_unregister(priv);
        v4l2_subdev_cleanup(&priv->sd);
-       fwnode_handle_put(priv->sd.fwnode);
        media_entity_cleanup(&priv->sd.entity);
 }