x86: tsc prevent time going backwards
[sfrench/cifs-2.6.git] / kernel / auditsc.c
index ac6d9b23b018676873026cc0334baccedeb2a7cc..782262e4107d42822b1a8cf756016ce47720456d 100644 (file)
@@ -1000,9 +1000,10 @@ static int audit_log_single_execve_arg(struct audit_context *context,
         * for strings that are too long, we should not have created
         * any.
         */
-       if (unlikely((len  = -1) || len > MAX_ARG_STRLEN - 1)) {
+       if (unlikely((len == -1) || len > MAX_ARG_STRLEN - 1)) {
                WARN_ON(1);
                send_sig(SIGKILL, current, 0);
+               return -1;
        }
 
        /* walk the whole argument looking for non-ascii chars */
@@ -1020,6 +1021,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
                if (ret) {
                        WARN_ON(1);
                        send_sig(SIGKILL, current, 0);
+                       return -1;
                }
                buf[to_send] = '\0';
                has_cntl = audit_string_contains_control(buf, to_send);
@@ -1068,7 +1070,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
                 * so we can be sure nothing was lost.
                 */
                if ((i == 0) && (too_long))
-                       audit_log_format(*ab, "a%d_len=%ld ", arg_num,
+                       audit_log_format(*ab, "a%d_len=%zu ", arg_num,
                                         has_cntl ? 2*len : len);
 
                /*
@@ -1083,6 +1085,7 @@ static int audit_log_single_execve_arg(struct audit_context *context,
                if (ret) {
                        WARN_ON(1);
                        send_sig(SIGKILL, current, 0);
+                       return -1;
                }
                buf[to_send] = '\0';