summaryrefslogtreecommitdiff
path: root/kernel/audit.c
diff options
context:
space:
mode:
authorShreenidhi Shedi <yesshedi@gmail.com>2022-05-15 13:01:09 +0530
committerPaul Moore <paul@paul-moore.com>2022-06-07 15:41:34 -0400
commit5ee6cfdd11aaf5aee5cd48baf35b1710caa68a5c (patch)
tree75af577de196166a575354d64e93e6f7dfb2f5a7 /kernel/audit.c
parentf2906aa863381afb0015a9eb7fefad885d4e5a56 (diff)
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>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r--kernel/audit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index 7690c29d4ee4..0749211d5552 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);
}