summaryrefslogtreecommitdiffstats
path: root/kernel/audit.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 27ffcf363f8d..d321e251d32b 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -625,7 +625,9 @@ unsigned int audit_serial(void)
unsigned int ret;
spin_lock_irqsave(&serial_lock, flags);
- ret = serial++;
+ do {
+ ret = ++serial;
+ } while (unlikely(!ret));
spin_unlock_irqrestore(&serial_lock, flags);
return ret;