aboutsummaryrefslogtreecommitdiffstats
path: root/ipc/ipcns_notifier.c
diff options
context:
space:
mode:
Diffstat (limited to 'ipc/ipcns_notifier.c')
-rw-r--r--ipc/ipcns_notifier.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/ipc/ipcns_notifier.c b/ipc/ipcns_notifier.c
index 70ff09183f7b..b9b31a4f77e1 100644
--- a/ipc/ipcns_notifier.c
+++ b/ipc/ipcns_notifier.c
@@ -55,25 +55,35 @@ static int ipcns_callback(struct notifier_block *self,
55 55
56int register_ipcns_notifier(struct ipc_namespace *ns) 56int register_ipcns_notifier(struct ipc_namespace *ns)
57{ 57{
58 int rc;
59
58 memset(&ns->ipcns_nb, 0, sizeof(ns->ipcns_nb)); 60 memset(&ns->ipcns_nb, 0, sizeof(ns->ipcns_nb));
59 ns->ipcns_nb.notifier_call = ipcns_callback; 61 ns->ipcns_nb.notifier_call = ipcns_callback;
60 ns->ipcns_nb.priority = IPCNS_CALLBACK_PRI; 62 ns->ipcns_nb.priority = IPCNS_CALLBACK_PRI;
61 return blocking_notifier_chain_register(&ipcns_chain, &ns->ipcns_nb); 63 rc = blocking_notifier_chain_register(&ipcns_chain, &ns->ipcns_nb);
64 if (!rc)
65 ns->auto_msgmni = 1;
66 return rc;
62} 67}
63 68
64int cond_register_ipcns_notifier(struct ipc_namespace *ns) 69int cond_register_ipcns_notifier(struct ipc_namespace *ns)
65{ 70{
71 int rc;
72
66 memset(&ns->ipcns_nb, 0, sizeof(ns->ipcns_nb)); 73 memset(&ns->ipcns_nb, 0, sizeof(ns->ipcns_nb));
67 ns->ipcns_nb.notifier_call = ipcns_callback; 74 ns->ipcns_nb.notifier_call = ipcns_callback;
68 ns->ipcns_nb.priority = IPCNS_CALLBACK_PRI; 75 ns->ipcns_nb.priority = IPCNS_CALLBACK_PRI;
69 return blocking_notifier_chain_cond_register(&ipcns_chain, 76 rc = blocking_notifier_chain_cond_register(&ipcns_chain,
70 &ns->ipcns_nb); 77 &ns->ipcns_nb);
78 if (!rc)
79 ns->auto_msgmni = 1;
80 return rc;
71} 81}
72 82
73int unregister_ipcns_notifier(struct ipc_namespace *ns) 83void unregister_ipcns_notifier(struct ipc_namespace *ns)
74{ 84{
75 return blocking_notifier_chain_unregister(&ipcns_chain, 85 blocking_notifier_chain_unregister(&ipcns_chain, &ns->ipcns_nb);
76 &ns->ipcns_nb); 86 ns->auto_msgmni = 0;
77} 87}
78 88
79int ipcns_notify(unsigned long val) 89int ipcns_notify(unsigned long val)