--- sys/kern/kern_sig.c.orig
+++ sys/kern/kern_sig.c
@@ -2766,7 +2766,7 @@
 	td->td_errno = nerror;
 
 	if (audited)
-		AUDIT_SYSCALL_EXIT(error, td);
+		AUDIT_SYSCALL_EXIT(tsr->ts_ret.sr_error, td);
 	if (!sy_thr_static)
 		syscall_thread_exit(td, se);
 }
