From: Shreenidhi Shedi Date: Sun, 15 May 2022 07:31:09 +0000 (+0530) Subject: audit: remove redundant data_len check X-Git-Tag: v6.1-rc5~761^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5ee6cfdd11aaf5aee5cd48baf35b1710caa68a5c;p=platform%2Fkernel%2Flinux-starfive.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 Signed-off-by: Paul Moore --- diff --git a/kernel/audit.c b/kernel/audit.c index 7690c29..0749211 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); }