From: Shreenidhi Shedi <yesshedi@gmail.com> Date: Sun, 15 May 2022 07:31:09 +0000 (+0530) Subject: audit: remove redundant data_len check X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=5ee6cfdd11aaf5aee5cd48baf35b1710caa68a5c;p=linux.git audit: remove redundant data_len check 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> --- diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29d4ee44..0749211d55525 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -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); }