All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ricardo Ribalda Delgado <ribalda@kernel.org>
To: "André Apitzsch" <git@apitzsch.eu>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht
Subject: Re: [PATCH v2 5/5] media: i2c: imx214: Fix cleanup after controls initialization error
Date: Sat, 28 Oct 2023 09:30:14 +0200	[thread overview]
Message-ID: <CAPybu_1rw8eC=hMXfW1aS-_vJNDnNGTJEL+_k=xK=q5ajz7kRw@mail.gmail.com> (raw)
In-Reply-To: <20231028-imx214-v2-5-69a8fb730d6e@apitzsch.eu>

Hi Andre

On Sat, Oct 28, 2023 at 9:19 AM André Apitzsch <git@apitzsch.eu> wrote:
>
> If the controls are initialized incorrectly, don't destroy the mutex not
> initialized yet and don't free controls as that is handled in
> imx214_ctrls_init().
>
> Signed-off-by: André Apitzsch <git@apitzsch.eu>

Since you are calling v4l2_ctrl_handler_free() in imx214_ctrls_init, I
think you should squash this patch with 2/5.

Sorry for asking for a follow-up patch :S

Regards!


> ---
>  drivers/media/i2c/imx214.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/media/i2c/imx214.c b/drivers/media/i2c/imx214.c
> index e0d9624a9d3f..0aba28d6dc2f 100644
> --- a/drivers/media/i2c/imx214.c
> +++ b/drivers/media/i2c/imx214.c
> @@ -1069,7 +1069,7 @@ static int imx214_probe(struct i2c_client *client)
>
>         ret = imx214_ctrls_init(imx214);
>         if (ret < 0)
> -               goto free_ctrl;
> +               goto error_power_off;
>
>         mutex_init(&imx214->mutex);
>         imx214->ctrls.lock = &imx214->mutex;
> @@ -1100,6 +1100,7 @@ static int imx214_probe(struct i2c_client *client)
>  free_ctrl:
>         mutex_destroy(&imx214->mutex);
>         v4l2_ctrl_handler_free(&imx214->ctrls);
> +error_power_off:
>         pm_runtime_disable(imx214->dev);
>
>         return ret;
>
> --
> 2.42.0
>

  reply	other threads:[~2023-10-28  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-28  7:17 [PATCH v2 0/5] media: i2c: imx214: Extend with sensor size and firmware information André Apitzsch
2023-10-28  7:17 ` [PATCH v2 1/5] media: i2c: imx214: Explain some magic numbers André Apitzsch
2023-10-28  7:17 ` [PATCH v2 2/5] media: i2c: imx214: Move controls init to separate function André Apitzsch
2023-10-28  7:17 ` [PATCH v2 3/5] media: i2c: imx214: Read orientation and rotation from system firmware André Apitzsch
2023-10-28  7:17 ` [PATCH v2 4/5] media: i2c: imx214: Add sensor's pixel matrix size André Apitzsch
2023-10-28  7:17 ` [PATCH v2 5/5] media: i2c: imx214: Fix cleanup after controls initialization error André Apitzsch
2023-10-28  7:30   ` Ricardo Ribalda Delgado [this message]
2023-10-28  7:51     ` André Apitzsch
2023-10-28  8:12       ` Ricardo Ribalda Delgado

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='CAPybu_1rw8eC=hMXfW1aS-_vJNDnNGTJEL+_k=xK=q5ajz7kRw@mail.gmail.com' \
    --to=ribalda@kernel.org \
    --cc=git@apitzsch.eu \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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.