提交 d865e573 编写于 作者: M Markus Elfring 提交者: Paul Moore

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: NMarkus Elfring <elfring@users.sourceforge.net>
[PM: tweak patch prefix]
Signed-off-by: NPaul Moore <pmoore@redhat.com>
上级 1194b994
......@@ -508,8 +508,7 @@ 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);
consume_skb(skb);
}
static int kauditd_thread(void *dummy)
......@@ -1232,9 +1231,7 @@ static void audit_buffer_free(struct audit_buffer *ab)
if (!ab)
return;
if (ab->skb)
kfree_skb(ab->skb);
kfree_skb(ab->skb);
spin_lock_irqsave(&audit_freelist_lock, flags);
if (audit_freelist_count > AUDIT_MAXFREE)
kfree(ab);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册