Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d865e573 authored by Markus Elfring's avatar Markus Elfring Committed by Paul Moore
Browse files

audit: Delete unnecessary checks before two function calls



The functions consume_skb() and kfree_skb() test whether their argument
is NULL and then return immediately.
Thus the tests around their calls are not needed.

This issue was detected by using the Coccinelle software.

Signed-off-by: default avatarMarkus Elfring <elfring@users.sourceforge.net>
[PM: tweak patch prefix]
Signed-off-by: default avatarPaul Moore <pmoore@redhat.com>
parent 1194b994
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -508,7 +508,6 @@ static void flush_hold_queue(void)
	 * if auditd just disappeared but we
	 * dequeued an skb we need to drop ref
	 */
	if (skb)
	consume_skb(skb);
}

@@ -1232,9 +1231,7 @@ static void audit_buffer_free(struct audit_buffer *ab)
	if (!ab)
		return;

	if (ab->skb)
	kfree_skb(ab->skb);

	spin_lock_irqsave(&audit_freelist_lock, flags);
	if (audit_freelist_count > AUDIT_MAXFREE)
		kfree(ab);