aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/of/unittest.c
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-05-03 15:49:50 -0400
committerRob Herring <robh@kernel.org>2017-05-04 12:07:38 -0400
commit8756cd1ded1af222fda4470b08ba547f5625e656 (patch)
treedc86e35b0f65288fabc372dbd5073cddc2c8fc3a /drivers/of/unittest.c
parentee320b33b4a316e22612ad6409517fc647f2a37c (diff)
of/unittest: Missing unlocks on error
Static checkers complain that we should unlock before returning. Which is true. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by: Frank Rowand <frank.rowand@sony.com> Signed-off-by: Rob Herring <robh@kernel.org>
Diffstat (limited to 'drivers/of/unittest.c')
-rw-r--r--drivers/of/unittest.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/of/unittest.c b/drivers/of/unittest.c
index 6b8f3e6aa43c..987a1530282a 100644
--- a/drivers/of/unittest.c
+++ b/drivers/of/unittest.c
@@ -2210,14 +2210,14 @@ static __init void of_unittest_overlay_high_level(void)
2210 unittest(0, 2210 unittest(0,
2211 "duplicate property '%s' in overlay_base node __symbols__", 2211 "duplicate property '%s' in overlay_base node __symbols__",
2212 prop->name); 2212 prop->name);
2213 return; 2213 goto err_unlock;
2214 } 2214 }
2215 ret = __of_add_property_sysfs(of_symbols, prop); 2215 ret = __of_add_property_sysfs(of_symbols, prop);
2216 if (ret) { 2216 if (ret) {
2217 unittest(0, 2217 unittest(0,
2218 "unable to add property '%s' in overlay_base node __symbols__ to sysfs", 2218 "unable to add property '%s' in overlay_base node __symbols__ to sysfs",
2219 prop->name); 2219 prop->name);
2220 return; 2220 goto err_unlock;
2221 } 2221 }
2222 } 2222 }
2223 } 2223 }
@@ -2232,6 +2232,10 @@ static __init void of_unittest_overlay_high_level(void)
2232 2232
2233 unittest(overlay_data_add(2), 2233 unittest(overlay_data_add(2),
2234 "Adding overlay 'overlay_bad_phandle' failed\n"); 2234 "Adding overlay 'overlay_bad_phandle' failed\n");
2235 return;
2236
2237err_unlock:
2238 mutex_unlock(&of_mutex);
2235} 2239}
2236 2240
2237#else 2241#else