diff options
| author | Gao feng <gaofeng@cn.fujitsu.com> | 2013-12-16 22:10:41 -0500 |
|---|---|---|
| committer | Eric Paris <eparis@redhat.com> | 2014-01-13 22:32:44 -0500 |
| commit | 11ee39ebf756821966fe1e2f65df4f728098d467 (patch) | |
| tree | 2bbdc6929b99f9a2d179a47b95f6674141177521 /kernel | |
| parent | 5ee9a75c9fdaebd3ac8176f9f5c73fdcd27c1ad1 (diff) | |
audit: print error message when fail to create audit socket
print the error message and then return -ENOMEM.
Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Acked-by: Eric Paris <eparis@redhat.com>
Signed-off-by: Richard Guy Briggs <rgb@redhat.com>
Signed-off-by: Eric Paris <eparis@redhat.com>
Diffstat (limited to 'kernel')
| -rw-r--r-- | kernel/audit.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/kernel/audit.c b/kernel/audit.c index 15661ef8bece..b27b7063654c 100644 --- a/kernel/audit.c +++ b/kernel/audit.c | |||
| @@ -1082,12 +1082,11 @@ static int __net_init audit_net_init(struct net *net) | |||
| 1082 | pr_info("audit: initializing netlink socket in namespace\n"); | 1082 | pr_info("audit: initializing netlink socket in namespace\n"); |
| 1083 | 1083 | ||
| 1084 | aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg); | 1084 | aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg); |
| 1085 | if (aunet->nlsk == NULL) | 1085 | if (aunet->nlsk == NULL) { |
| 1086 | return -ENOMEM; | ||
| 1087 | if (!aunet->nlsk) | ||
| 1088 | audit_panic("cannot initialize netlink socket in namespace"); | 1086 | audit_panic("cannot initialize netlink socket in namespace"); |
| 1089 | else | 1087 | return -ENOMEM; |
| 1090 | aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; | 1088 | } |
| 1089 | aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; | ||
| 1091 | return 0; | 1090 | return 0; |
| 1092 | } | 1091 | } |
| 1093 | 1092 | ||
