From 11ee39ebf756821966fe1e2f65df4f728098d467 Mon Sep 17 00:00:00 2001 From: Gao feng Date: Tue, 17 Dec 2013 11:10:41 +0800 Subject: audit: print error message when fail to create audit socket print the error message and then return -ENOMEM. Signed-off-by: Gao feng Acked-by: Eric Paris Signed-off-by: Richard Guy Briggs Signed-off-by: Eric Paris --- kernel/audit.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'kernel/audit.c') 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) pr_info("audit: initializing netlink socket in namespace\n"); aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg); - if (aunet->nlsk == NULL) - return -ENOMEM; - if (!aunet->nlsk) + if (aunet->nlsk == NULL) { audit_panic("cannot initialize netlink socket in namespace"); - else - aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; + return -ENOMEM; + } + aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; return 0; } -- cgit v1.2.3