diff options
author | Markus Elfring <elfring@users.sourceforge.net> | 2016-01-13 17:18:55 +0300 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2016-01-13 17:18:55 +0300 |
commit | d865e573b8a4f30fbb74fa7666ca81e3132eb547 (patch) | |
tree | dc60aea2e30e642328342413c2de397c010f0d46 /kernel/audit.c | |
parent | 1194b994bec308433cc84ffdb92fd668713b8f93 (diff) | |
download | linux-d865e573b8a4f30fbb74fa7666ca81e3132eb547.tar.xz |
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: Markus Elfring <elfring@users.sourceforge.net>
[PM: tweak patch prefix]
Signed-off-by: Paul Moore <pmoore@redhat.com>
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index d7b675781934..d6dd95cc59e6 100644 --- a/kernel/audit.c +++ b/kernel/audit.c @@ -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); |