Skip to content

Commit 8756cd1

Browse files
Dan Carpenterrobherring
authored andcommitted
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>
1 parent ee320b3 commit 8756cd1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

drivers/of/unittest.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2210,14 +2210,14 @@ static __init void of_unittest_overlay_high_level(void)
22102210
unittest(0,
22112211
"duplicate property '%s' in overlay_base node __symbols__",
22122212
prop->name);
2213-
return;
2213+
goto err_unlock;
22142214
}
22152215
ret = __of_add_property_sysfs(of_symbols, prop);
22162216
if (ret) {
22172217
unittest(0,
22182218
"unable to add property '%s' in overlay_base node __symbols__ to sysfs",
22192219
prop->name);
2220-
return;
2220+
goto err_unlock;
22212221
}
22222222
}
22232223
}
@@ -2232,6 +2232,10 @@ static __init void of_unittest_overlay_high_level(void)
22322232

22332233
unittest(overlay_data_add(2),
22342234
"Adding overlay 'overlay_bad_phandle' failed\n");
2235+
return;
2236+
2237+
err_unlock:
2238+
mutex_unlock(&of_mutex);
22352239
}
22362240

22372241
#else

0 commit comments

Comments
 (0)