From: Dan Carpenter Date: Wed, 3 May 2017 19:49:50 +0000 (+0300) Subject: of/unittest: Missing unlocks on error X-Git-Tag: MMI-PSA29.97-13-9~5568^2~6 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=8756cd1ded1af222fda4470b08ba547f5625e656;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git of/unittest: Missing unlocks on error Static checkers complain that we should unlock before returning. Which is true. Signed-off-by: Dan Carpenter Reviewed-by: Frank Rowand Signed-off-by: Rob Herring --- 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) 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