aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/char/monwriter.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/s390/char/monwriter.c b/drivers/s390/char/monwriter.c
index 66fb8eba93f4..6532ed8b4afa 100644
--- a/drivers/s390/char/monwriter.c
+++ b/drivers/s390/char/monwriter.c
@@ -13,7 +13,6 @@
13#include <linux/moduleparam.h> 13#include <linux/moduleparam.h>
14#include <linux/init.h> 14#include <linux/init.h>
15#include <linux/errno.h> 15#include <linux/errno.h>
16#include <linux/smp_lock.h>
17#include <linux/types.h> 16#include <linux/types.h>
18#include <linux/kernel.h> 17#include <linux/kernel.h>
19#include <linux/miscdevice.h> 18#include <linux/miscdevice.h>
@@ -185,13 +184,11 @@ static int monwrite_open(struct inode *inode, struct file *filp)
185 monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL); 184 monpriv = kzalloc(sizeof(struct mon_private), GFP_KERNEL);
186 if (!monpriv) 185 if (!monpriv)
187 return -ENOMEM; 186 return -ENOMEM;
188 lock_kernel();
189 INIT_LIST_HEAD(&monpriv->list); 187 INIT_LIST_HEAD(&monpriv->list);
190 monpriv->hdr_to_read = sizeof(monpriv->hdr); 188 monpriv->hdr_to_read = sizeof(monpriv->hdr);
191 mutex_init(&monpriv->thread_mutex); 189 mutex_init(&monpriv->thread_mutex);
192 filp->private_data = monpriv; 190 filp->private_data = monpriv;
193 list_add_tail(&monpriv->priv_list, &mon_priv_list); 191 list_add_tail(&monpriv->priv_list, &mon_priv_list);
194 unlock_kernel();
195 return nonseekable_open(inode, filp); 192 return nonseekable_open(inode, filp);
196} 193}
197 194
@@ -364,6 +361,10 @@ static int __init mon_init(void)
364 goto out_driver; 361 goto out_driver;
365 } 362 }
366 363
364 /*
365 * misc_register() has to be the last action in module_init(), because
366 * file operations will be available right after this.
367 */
367 rc = misc_register(&mon_dev); 368 rc = misc_register(&mon_dev);
368 if (rc) 369 if (rc)
369 goto out_device; 370 goto out_device;