From: Lino Sanfilippo <LinoSanfilippo@gmx.de>
To: jic23@kernel.org
Cc: andy.shevchenko@gmail.com, lars@metafoo.de, pmeerw@pmeerw.net,
linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
Lino Sanfilippo <LinoSanfilippo@gmx.de>
Subject: [RESEND PATCH 2/2] io:core: In iio_map_array_register() cleanup in case of error
Date: Sat, 28 Nov 2020 14:44:19 +0100 [thread overview]
Message-ID: <1606571059-13974-2-git-send-email-LinoSanfilippo@gmx.de> (raw)
In-Reply-To: <1606571059-13974-1-git-send-email-LinoSanfilippo@gmx.de>
In function iio_map_array_register() properly rewind in case of error.
Signed-off-by: Lino Sanfilippo <LinoSanfilippo@gmx.de>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
---
drivers/iio/inkern.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
index 39c1d63..fe30bcb 100644
--- a/drivers/iio/inkern.c
+++ b/drivers/iio/inkern.c
@@ -60,6 +60,8 @@ int iio_map_array_register(struct iio_dev *indio_dev, struct iio_map *maps)
i++;
}
error_ret:
+ if (ret)
+ iio_map_array_unregister_locked(indio_dev);
mutex_unlock(&iio_map_list_lock);
return ret;
--
2.7.4
next prev parent reply other threads:[~2020-11-28 22:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-28 13:44 [RESEND PATCH 1/2] iio:core: Introduce unlocked version of iio_map_array_unregister() Lino Sanfilippo
2020-11-28 13:44 ` Lino Sanfilippo [this message]
2020-11-28 13:54 ` Jonathan Cameron
2020-11-28 14:22 ` Lino Sanfilippo
2020-11-29 13:08 ` Jonathan Cameron
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=1606571059-13974-2-git-send-email-LinoSanfilippo@gmx.de \
--to=linosanfilippo@gmx.de \
--cc=andy.shevchenko@gmail.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmeerw@pmeerw.net \
/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;
as well as URLs for NNTP newsgroup(s).