linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] i2c: do not leave semaphore armed when copying properties fails
@ 2017-03-08 18:41 Dmitry Torokhov
  2017-03-08 18:41 ` [PATCH 2/2] i2c: allow attaching IRQ resources to i2c_board_info Dmitry Torokhov
  2017-03-09 14:48 ` [PATCH 1/2] i2c: do not leave semaphore armed when copying properties fails Wolfram Sang
  0 siblings, 2 replies; 6+ messages in thread
From: Dmitry Torokhov @ 2017-03-08 18:41 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: linux-i2c, linux-kernel

We should not leave i2c_register_board_info() early, without unlocking the
__i2c_board_lock.

Fixes: b0c1e95ab44f ("i2c: copy device properties when using ...")
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/i2c/i2c-boardinfo.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/i2c/i2c-boardinfo.c b/drivers/i2c/i2c-boardinfo.c
index 5b8f6c3a6950..0e285c68b2ff 100644
--- a/drivers/i2c/i2c-boardinfo.c
+++ b/drivers/i2c/i2c-boardinfo.c
@@ -84,8 +84,10 @@ int i2c_register_board_info(int busnum, struct i2c_board_info const *info, unsig
 		if (info->properties) {
 			devinfo->board_info.properties =
 					property_entries_dup(info->properties);
-			if (IS_ERR(devinfo->board_info.properties))
-				return PTR_ERR(devinfo->board_info.properties);
+			if (IS_ERR(devinfo->board_info.properties)) {
+				status = PTR_ERR(devinfo->board_info.properties);
+				break;
+			}
 		}
 
 		list_add_tail(&devinfo->list, &__i2c_board_list);
-- 
2.12.0.246.ga2ecc84866-goog

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-03-20 17:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-08 18:41 [PATCH 1/2] i2c: do not leave semaphore armed when copying properties fails Dmitry Torokhov
2017-03-08 18:41 ` [PATCH 2/2] i2c: allow attaching IRQ resources to i2c_board_info Dmitry Torokhov
2017-03-09 14:48 ` [PATCH 1/2] i2c: do not leave semaphore armed when copying properties fails Wolfram Sang
2017-03-09 17:38   ` Dmitry Torokhov
2017-03-09 23:16     ` Wolfram Sang
2017-03-20 17:06       ` Dmitry Torokhov

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).