summaryrefslogtreecommitdiff
path: root/drivers/of
diff options
context:
space:
mode:
authorDan Carpenter <dan.carpenter@oracle.com>2017-05-03 22:49:50 +0300
committerRob Herring <robh@kernel.org>2017-05-04 19:07:38 +0300
commit8756cd1ded1af222fda4470b08ba547f5625e656 (patch)
treedc86e35b0f65288fabc372dbd5073cddc2c8fc3a /drivers/of
parentee320b33b4a316e22612ad6409517fc647f2a37c (diff)
downloadlinux-8756cd1ded1af222fda4470b08ba547f5625e656.tar.xz
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')
-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)
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