From: Julien Massot <julien.massot@collabora.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Hans Verkuil <hverkuil-cisco@xs4all.nl>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] media: i2c: max96717: clean up on error in max96717_subdev_init()
Date: Fri, 27 Sep 2024 12:47:03 +0200 [thread overview]
Message-ID: <8d281bcbc504abaa9838ff666a36515cf7e57239.camel@collabora.com> (raw)
In-Reply-To: <23251b8e-c148-44ef-bc9b-f39cecc4fb12@stanley.mountain>
Hi,
On Thu, 2024-09-12 at 11:51 +0300, Dan Carpenter wrote:
> Call v4l2_ctrl_handler_free() to clean up from
> v4l2_ctrl_handler_init().
>
> Fixes: 50f222455793 ("media: i2c: add MAX96717 driver")
The right commit to fix is:
Fixes: 19b5e5511ca4f ("media: i2c: max96717: add test pattern ctrl")
Since there was no control to free in the initial driver.
Reviewed-by: Julien Massot <julien.massot@collabora.com>
Regards,
Julien
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> From static analysis. Not tested.
>
> drivers/media/i2c/max96717.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/media/i2c/max96717.c
> b/drivers/media/i2c/max96717.c
> index 4e85b8eb1e77..9259d58ba734 100644
> --- a/drivers/media/i2c/max96717.c
> +++ b/drivers/media/i2c/max96717.c
> @@ -697,8 +697,10 @@ static int max96717_subdev_init(struct
> max96717_priv *priv)
> priv->pads[MAX96717_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
>
> ret = media_entity_pads_init(&priv->sd.entity, 2, priv-
> >pads);
> - if (ret)
> - return dev_err_probe(dev, ret, "Failed to init
> pads\n");
> + if (ret) {
> + dev_err_probe(dev, ret, "Failed to init pads\n");
> + goto err_free_ctrl;
> + }
>
> ret = v4l2_subdev_init_finalize(&priv->sd);
> if (ret) {
--
--
Julien Massot
Senior Software Engineer
Collabora Ltd.
Platinum Building, St John's Innovation Park, Cambridge CB4 0DS, UK
Registered in England & Wales, no. 5513718
next prev parent reply other threads:[~2024-09-27 10:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-12 8:51 Dan Carpenter
2024-09-27 10:47 ` Julien Massot [this message]
2024-09-27 10:57 ` Dan Carpenter
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=8d281bcbc504abaa9838ff666a36515cf7e57239.camel@collabora.com \
--to=julien.massot@collabora.com \
--cc=dan.carpenter@linaro.org \
--cc=hverkuil-cisco@xs4all.nl \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.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®