public inbox for linux-audit@redhat.com
 help / color / mirror / Atom feed
* [PATCH 1/2] audit: print error message when fail to create audit socket
@ 2013-12-17  3:10 Gao feng
  2013-12-17  3:10 ` [PATCH 2/2] audit: fix incorrect set of audit_sock Gao feng
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Gao feng @ 2013-12-17  3:10 UTC (permalink / raw)
  To: linux-audit; +Cc: linux-kernel, rgb, eparis, Gao feng

print the error message and then return -ENOMEM.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
---
 kernel/audit.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/kernel/audit.c b/kernel/audit.c
index 2a0ed0b..041b951 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -1083,12 +1083,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;
 }
 
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-01-08  3:30 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-17  3:10 [PATCH 1/2] audit: print error message when fail to create audit socket Gao feng
2013-12-17  3:10 ` [PATCH 2/2] audit: fix incorrect set of audit_sock Gao feng
2013-12-17 16:02   ` Eric Paris
2013-12-20  1:38   ` Richard Guy Briggs
2013-12-17 15:56 ` [PATCH 1/2] audit: print error message when fail to create audit socket Eric Paris
2013-12-20  1:34   ` Richard Guy Briggs
2014-01-08  0:53 ` Andrew Morton
2014-01-08  1:18   ` Gao feng
2014-01-08  3:30     ` Richard Guy Briggs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox