]> git.baikalelectronics.ru Git - kernel.git/commitdiff
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 7690c29d4ee44e009d7a547aab23836c3ca918b2..0749211d55525288aa33df33f19ff6344cc39378 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);
                        }