summaryrefslogtreecommitdiffstats
path: root/kernel/kexec_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/kexec_internal.h')
-rw-r--r--kernel/kexec_internal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/kexec_internal.h b/kernel/kexec_internal.h
index 2595defe8c0d..d35d9792402d 100644
--- a/kernel/kexec_internal.h
+++ b/kernel/kexec_internal.h
@@ -23,7 +23,8 @@ int kimage_is_destination_range(struct kimage *image,
extern atomic_t __kexec_lock;
static inline bool kexec_trylock(void)
{
- return atomic_cmpxchg_acquire(&__kexec_lock, 0, 1) == 0;
+ int old = 0;
+ return atomic_try_cmpxchg_acquire(&__kexec_lock, &old, 1);
}
static inline void kexec_unlock(void)
{