audit: remove redundant data_len check
authorShreenidhi Shedi <yesshedi@gmail.com>
Sun, 15 May 2022 07:31:09 +0000 (13:01 +0530)
committerPaul Moore <paul@paul-moore.com>
Tue, 7 Jun 2022 19:41:34 +0000 (15:41 -0400)
data_len is already getting checked if it's less than 2 earlier in this
function.

Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Signed-off-by: Paul Moore <paul@paul-moore.com>
kernel/audit.c

index 7690c29..0749211 100644 (file)
@@ -1390,7 +1390,7 @@ static int audit_receive_msg(struct sk_buff *skb, struct nlmsghdr *nlh)
                                                 str);
                        } else {
                                audit_log_format(ab, " data=");
-                               if (data_len > 0 && str[data_len - 1] == '\0')
+                               if (str[data_len - 1] == '\0')
                                        data_len--;
                                audit_log_n_untrustedstring(ab, str, data_len);
                        }