From: Sakari Ailus <sakari.ailus@linux.intel.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Jai Luthra <jai.luthra@ideasonboard.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3 01/15] media: i2c: ds90ub9x3: Fix extra fwnode_handle_put()
Date: Mon, 9 Dec 2024 09:09:13 +0000 [thread overview]
Message-ID: <Z1azue3G14MQpfiI@kekkonen.localdomain> (raw)
In-Reply-To: <20241204-ub9xx-fixes-v3-1-a933c109b323@ideasonboard.com>
Huomenta,
On Wed, Dec 04, 2024 at 01:05:15PM +0200, Tomi Valkeinen wrote:
> 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
This is, in fact, an extra put. It'll lead to underflow, not overflow.
I'd expect removing it once would be already too much.
> 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.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Cc: stable@vger.kernel.org
> Fixes: 905f88ccebb1 ("media: i2c: ds90ub9x3: Fix sub-device matching")
> ---
> drivers/media/i2c/ds90ub913.c | 1 -
> drivers/media/i2c/ds90ub953.c | 1 -
> 2 files changed, 2 deletions(-)
>
> diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c
> index 8eed4a200fd8..b5375d736629 100644
> --- a/drivers/media/i2c/ds90ub913.c
> +++ b/drivers/media/i2c/ds90ub913.c
> @@ -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);
> }
>
> diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c
> index 16f88db14981..10daecf6f457 100644
> --- a/drivers/media/i2c/ds90ub953.c
> +++ b/drivers/media/i2c/ds90ub953.c
> @@ -1291,7 +1291,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);
> }
>
>
--
Terveisin,
Sakari Ailus
next prev parent reply other threads:[~2024-12-09 9:09 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-04 11:05 [PATCH v3 00/15] media: i2c: ds90ub9xx: Misc fixes and improvements Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 01/15] media: i2c: ds90ub9x3: Fix extra fwnode_handle_put() Tomi Valkeinen
2024-12-09 9:09 ` Sakari Ailus [this message]
2024-12-09 9:46 ` Tomi Valkeinen
2024-12-09 9:53 ` Sakari Ailus
2024-12-04 11:05 ` [PATCH v3 02/15] media: i2c: ds90ub960: Fix UB9702 refclk register access Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 03/15] media: i2c: ds90ub960: Fix use of non-existing registers on UB9702 Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 04/15] media: i2c: ds90ub960: Fix logging SP & EQ status only for UB9702 Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 05/15] media: i2c: ds90ub960: Fix UB9702 VC map Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 06/15] media: i2c: ds90ub960: Use HZ_PER_MHZ Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 07/15] media: i2c: ds90ub960: Add support for I2C_RX_ID Tomi Valkeinen
2024-12-05 8:31 ` Andy Shevchenko
2024-12-05 12:00 ` Jai Luthra
2024-12-05 14:02 ` Tomi Valkeinen
2024-12-05 13:59 ` Tomi Valkeinen
2024-12-05 19:36 ` Andy Shevchenko
2024-12-06 7:24 ` Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 08/15] media: i2c: ds90ub960: Add RGB24, RAW8 and RAW10 formats Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 09/15] media: i2c: ds90ub953: Clear CRC errors in ub953_log_status() Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 10/15] media: i2c: ds90ub960: Drop unused indirect block define Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 11/15] media: i2c: ds90ub960: Reduce sleep in ub960_rxport_wait_locks() Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 12/15] media: i2c: ds90ub960: Handle errors in ub960_log_status_ub960_sp_eq() Tomi Valkeinen
2024-12-05 8:33 ` Andy Shevchenko
2024-12-04 11:05 ` [PATCH v3 13/15] media: i2c: ds90ub913: Add error handling to ub913_hw_init() Tomi Valkeinen
2024-12-04 11:05 ` [PATCH v3 14/15] media: i2c: ds90ub953: Add error handling for i2c reads/writes Tomi Valkeinen
2024-12-05 8:34 ` Andy Shevchenko
2024-12-04 11:05 ` [PATCH v3 15/15] media: i2c: ds90ub960: Fix shadowing of local variables Tomi Valkeinen
2024-12-05 13:50 ` [PATCH v3 00/15] media: i2c: ds90ub9xx: Misc fixes and improvements Jai Luthra
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Z1azue3G14MQpfiI@kekkonen.localdomain \
--to=sakari.ailus@linux.intel.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=jai.luthra@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=stable@vger.kernel.org \
--cc=tomi.valkeinen@ideasonboard.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®