mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 18:50:05 +01:00
xen/nospec: Remove unreachable code
When CONFIG_SPECULATIVE_HARDEN_LOCK is active, this reads:
static always_inline bool lock_evaluate_nospec(bool condition)
{
return arch_lock_evaluate_nospec(condition);
return condition;
}
Insert an #else to take out the second return.
Fixes: 7ef0084418 ("x86/spinlock: introduce support for blocking speculation into critical regions")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
Reviewed-by: Stefano Stabellini <sstabellini@kernel.org>
This commit is contained in:
1 parent
d0a718a45f
commit
52bde26c1c
1 file changed
+2
-1
@@ -82,8 +82,9 @@ static always_inline bool lock_evaluate_nospec(bool condition)
|
||||
{
|
||||
#ifdef CONFIG_SPECULATIVE_HARDEN_LOCK
|
||||
return arch_lock_evaluate_nospec(condition);
|
||||
#endif
|
||||
#else
|
||||
return condition;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif /* XEN_NOSPEC_H */
|
||||
|
||||