devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] of/unittest: Missing unlocks on error
@ 2017-05-03 19:49 Dan Carpenter
  2017-05-04  0:05 ` Frank Rowand
  2017-05-04 16:09 ` Rob Herring
  0 siblings, 2 replies; 3+ messages in thread
From: Dan Carpenter @ 2017-05-03 19:49 UTC (permalink / raw)
  To: Rob Herring, Frank Rowand; +Cc: Frank Rowand, devicetree, kernel-janitors

Static checkers complain that we should unlock before returning.  Which
is true.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 12597ff8cfb0..425338d6286d 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2210,14 +2210,14 @@ static __init void of_unittest_overlay_high_level(void)
 				unittest(0,
 					 "duplicate property '%s' in overlay_base node __symbols__",
 					 prop->name);
-				return;
+				goto err_unlock;
 			}
 			ret = __of_add_property_sysfs(of_symbols, prop);
 			if (ret) {
 				unittest(0,
 					 "unable to add property '%s' in overlay_base node __symbols__ to sysfs",
 					 prop->name);
-				return;
+				goto err_unlock;
 			}
 		}
 	}
@@ -2232,6 +2232,10 @@ static __init void of_unittest_overlay_high_level(void)
 
 	unittest(overlay_data_add(2),
 		 "Adding overlay 'overlay_bad_phandle' failed\n");
+	return;
+
+err_unlock:
+	mutex_unlock(&of_mutex);
 }
 
 #else

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

end of thread, other threads:[~2017-05-04 16:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-03 19:49 [PATCH] of/unittest: Missing unlocks on error Dan Carpenter
2017-05-04  0:05 ` Frank Rowand
2017-05-04 16:09 ` Rob Herring

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