aboutsummaryrefslogtreecommitdiffstats
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)
625 unsigned int ret; 625 unsigned int ret;
626 626
627 spin_lock_irqsave(&serial_lock, flags); 627 spin_lock_irqsave(&serial_lock, flags);
628 ret = serial++; 628 do {
629 ret = ++serial;
630 } while (unlikely(!ret));
629 spin_unlock_irqrestore(&serial_lock, flags); 631 spin_unlock_irqrestore(&serial_lock, flags);
630 632
631 return ret; 633 return ret;