From: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
To: Biren Pandya <birenpandya@gmail.com>
Cc: linux-media@vger.kernel.org, Mauro Carvalho Chehab <mchehab@kernel.org>
Subject: Re: [PATCH 3/5] media: i2c: msp3400-driver: Add missing media_entity_cleanup()
Date: Mon, 22 Jun 2026 10:34:08 +0200 [thread overview]
Message-ID: <ajjy32bp9BEjs_pq@zed> (raw)
In-Reply-To: <20260619100126.22197-10-birenpandya@gmail.com>
Hi Biren
On Fri, Jun 19, 2026 at 03:31:30PM +0530, Biren Pandya wrote:
> The probe error paths and remove function are missing calls to
> media_entity_cleanup(). Add them to prevent memory leaks if pads
> are dynamically allocated.
>
> Signed-off-by: Biren Pandya <birenpandya@gmail.com>
> ---
> drivers/media/i2c/msp3400-driver.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/i2c/msp3400-driver.c b/drivers/media/i2c/msp3400-driver.c
> index 4c0b0ad68c08..d977a6039e6c 100644
> --- a/drivers/media/i2c/msp3400-driver.c
> +++ b/drivers/media/i2c/msp3400-driver.c
> @@ -812,6 +812,7 @@ static int msp_probe(struct i2c_client *client)
> int err = hdl->error;
>
> v4l2_ctrl_handler_free(hdl);
> + media_entity_cleanup(&sd->entity);
This driver really seems a relic from the past, but if you want to add
media_entity_cleanup() to it, there is one previous error path after
media_entity_pads_init() where you might want to do that.
> return err;
> }
>
> @@ -865,6 +866,7 @@ static void msp_remove(struct i2c_client *client)
> msp_reset(client);
>
> v4l2_ctrl_handler_free(&state->hdl);
> + media_entity_cleanup(&state->sd.entity);
> }
>
> /* ----------------------------------------------------------------------- */
> --
> 2.50.1 (Apple Git-155)
>
>
next prev parent reply other threads:[~2026-06-22 8:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-19 10:01 [PATCH 0/5] media: i2c: Add missing media_entity_cleanup() calls Biren Pandya
2026-06-19 10:01 ` [PATCH 1/5] media: i2c: cx25840-core: Add missing media_entity_cleanup() Biren Pandya
2026-06-19 10:01 ` [PATCH 2/5] media: i2c: max9286: " Biren Pandya
2026-06-22 8:29 ` Jacopo Mondi
2026-06-19 10:01 ` [PATCH 3/5] media: i2c: msp3400-driver: " Biren Pandya
2026-06-22 8:34 ` Jacopo Mondi [this message]
2026-06-19 10:01 ` [PATCH 4/5] media: i2c: mt9v011: " Biren Pandya
2026-06-19 10:01 ` [PATCH 5/5] media: i2c: saa7115: " Biren Pandya
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=ajjy32bp9BEjs_pq@zed \
--to=jacopo.mondi@ideasonboard.com \
--cc=birenpandya@gmail.com \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.