From: Jonathan Cameron <jic23@kernel.org>
To: David Lechner <dlechner@baylibre.com>
Cc: linux-iio@vger.kernel.org, linux-staging@lists.linux.dev,
Michael Hennerich <Michael.Hennerich@analog.com>,
linux-kernel@vger.kernel.org, kernel test robot <lkp@intel.com>,
Dan Carpenter <dan.carpenter@linaro.org>
Subject: Re: [PATCH] staging: iio: resolver: ad2s1210: fix return with lock held
Date: Thu, 5 Oct 2023 15:04:03 +0100 [thread overview]
Message-ID: <20231005150403.453851f3@jic23-huawei> (raw)
In-Reply-To: <20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-v1-1-812b932997bd@baylibre.com>
On Wed, 4 Oct 2023 09:17:26 -0500
David Lechner <dlechner@baylibre.com> wrote:
> We missed a return statement in ad2s1210_initial() that would cause
> the lock to be held when returning an error.
>
> This is fixed by replacing the return with a goto to release the lock
> before returning.
>
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
> Closes: https://lore.kernel.org/r/202310030222.iokamE9T-lkp@intel.com/
> Fixes: 0d03d0e65846 ("staging: iio: resolver: ad2s1210: rework gpios")
> Signed-off-by: David Lechner <dlechner@baylibre.com>
> ---
> drivers/staging/iio/resolver/ad2s1210.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/iio/resolver/ad2s1210.c b/drivers/staging/iio/resolver/ad2s1210.c
> index 98afd2e9ea41..67d8af0dd7ae 100644
> --- a/drivers/staging/iio/resolver/ad2s1210.c
> +++ b/drivers/staging/iio/resolver/ad2s1210.c
> @@ -555,7 +555,7 @@ static int ad2s1210_initial(struct ad2s1210_state *st)
> mutex_lock(&st->lock);
> ret = ad2s1210_set_resolution_gpios(st, st->resolution);
> if (ret < 0)
> - return ret;
> + goto error_ret;
Ah. I squashed the same fix into the original patch as it wasn't yet on a non
rebasing tree.
Thanks
Jonathan
>
> /* Use default config register value plus resolution from devicetree. */
> data = FIELD_PREP(AD2S1210_PHASE_LOCK_RANGE_44, 1);
>
> ---
> base-commit: a533eeaef80e879b3ad1937eee7a43d1f9961c5d
> change-id: 20231004-staging-iio-resolver-ad2s1210-fix-return-with-lock-held-f547ce6fae49
prev parent reply other threads:[~2023-10-05 14:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-04 14:17 [PATCH] staging: iio: resolver: ad2s1210: fix return with lock held David Lechner
2023-10-05 14:04 ` Jonathan Cameron [this message]
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=20231005150403.453851f3@jic23-huawei \
--to=jic23@kernel.org \
--cc=Michael.Hennerich@analog.com \
--cc=dan.carpenter@linaro.org \
--cc=dlechner@baylibre.com \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=lkp@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