Skip to content

Commit

Permalink
audit: remove redundant data_len check
Browse files Browse the repository at this point in the history
data_len is already getting checked if it's less than 2 earlier in this
function.

Signed-off-by: Shreenidhi Shedi <[email protected]>
Signed-off-by: Paul Moore <[email protected]>
  • Loading branch information
sshedi authored and pcmoore committed Jun 7, 2022
1 parent f2906aa commit 5ee6cfd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/audit.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 5ee6cfd

Please sign in to comment.