Commit 11ee39eb authored by Gao feng's avatar Gao feng Committed by Eric Paris

audit: print error message when fail to create audit socket

print the error message and then return -ENOMEM.
Signed-off-by: default avatarGao feng <gaofeng@cn.fujitsu.com>
Acked-by: default avatarEric Paris <eparis@redhat.com>
Signed-off-by: default avatarRichard Guy Briggs <rgb@redhat.com>
Signed-off-by: default avatarEric Paris <eparis@redhat.com>
parent 5ee9a75c
...@@ -1082,11 +1082,10 @@ static int __net_init audit_net_init(struct net *net) ...@@ -1082,11 +1082,10 @@ static int __net_init audit_net_init(struct net *net)
pr_info("audit: initializing netlink socket in namespace\n"); pr_info("audit: initializing netlink socket in namespace\n");
aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg); aunet->nlsk = netlink_kernel_create(net, NETLINK_AUDIT, &cfg);
if (aunet->nlsk == NULL) if (aunet->nlsk == NULL) {
return -ENOMEM;
if (!aunet->nlsk)
audit_panic("cannot initialize netlink socket in namespace"); audit_panic("cannot initialize netlink socket in namespace");
else return -ENOMEM;
}
aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT; aunet->nlsk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment