diff options
Diffstat (limited to 'kernel/audit.c')
-rw-r--r-- | kernel/audit.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index d417ca1db79b..963fd15c9621 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
@@ -690,9 +690,7 @@ static const struct inotify_operations audit_inotify_ops = { | |||
690 | /* Initialize audit support at boot time. */ | 690 | /* Initialize audit support at boot time. */ |
691 | static int __init audit_init(void) | 691 | static int __init audit_init(void) |
692 | { | 692 | { |
693 | #ifdef CONFIG_AUDITSYSCALL | ||
694 | int i; | 693 | int i; |
695 | #endif | ||
696 | 694 | ||
697 | printk(KERN_INFO "audit: initializing netlink socket (%s)\n", | 695 | printk(KERN_INFO "audit: initializing netlink socket (%s)\n", |
698 | audit_default ? "enabled" : "disabled"); | 696 | audit_default ? "enabled" : "disabled"); |
@@ -717,10 +715,10 @@ static int __init audit_init(void) | |||
717 | audit_ih = inotify_init(&audit_inotify_ops); | 715 | audit_ih = inotify_init(&audit_inotify_ops); |
718 | if (IS_ERR(audit_ih)) | 716 | if (IS_ERR(audit_ih)) |
719 | audit_panic("cannot initialize inotify handle"); | 717 | audit_panic("cannot initialize inotify handle"); |
718 | #endif | ||
720 | 719 | ||
721 | for (i = 0; i < AUDIT_INODE_BUCKETS; i++) | 720 | for (i = 0; i < AUDIT_INODE_BUCKETS; i++) |
722 | INIT_LIST_HEAD(&audit_inode_hash[i]); | 721 | INIT_LIST_HEAD(&audit_inode_hash[i]); |
723 | #endif | ||
724 | 722 | ||
725 | return 0; | 723 | return 0; |
726 | } | 724 | } |
@@ -1030,6 +1028,9 @@ void audit_log_hex(struct audit_buffer *ab, const unsigned char *buf, | |||
1030 | struct sk_buff *skb; | 1028 | struct sk_buff *skb; |
1031 | static const unsigned char *hex = "0123456789ABCDEF"; | 1029 | static const unsigned char *hex = "0123456789ABCDEF"; |
1032 | 1030 | ||
1031 | if (!ab) | ||
1032 | return; | ||
1033 | |||
1033 | BUG_ON(!ab->skb); | 1034 | BUG_ON(!ab->skb); |
1034 | skb = ab->skb; | 1035 | skb = ab->skb; |
1035 | avail = skb_tailroom(skb); | 1036 | avail = skb_tailroom(skb); |
@@ -1062,6 +1063,9 @@ static void audit_log_n_string(struct audit_buffer *ab, size_t slen, | |||
1062 | unsigned char *ptr; | 1063 | unsigned char *ptr; |
1063 | struct sk_buff *skb; | 1064 | struct sk_buff *skb; |
1064 | 1065 | ||
1066 | if (!ab) | ||
1067 | return; | ||
1068 | |||
1065 | BUG_ON(!ab->skb); | 1069 | BUG_ON(!ab->skb); |
1066 | skb = ab->skb; | 1070 | skb = ab->skb; |
1067 | avail = skb_tailroom(skb); | 1071 | avail = skb_tailroom(skb); |