aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_devintf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char/ipmi/ipmi_devintf.c')
-rw-r--r--drivers/char/ipmi/ipmi_devintf.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/char/ipmi/ipmi_devintf.c b/drivers/char/ipmi/ipmi_devintf.c
index 0246a2b8ce48..c816656d6bfb 100644
--- a/drivers/char/ipmi/ipmi_devintf.c
+++ b/drivers/char/ipmi/ipmi_devintf.c
@@ -43,6 +43,7 @@
43#include <linux/init.h> 43#include <linux/init.h>
44#include <linux/device.h> 44#include <linux/device.h>
45#include <linux/compat.h> 45#include <linux/compat.h>
46#include <linux/smp_lock.h>
46 47
47struct ipmi_file_private 48struct ipmi_file_private
48{ 49{
@@ -121,6 +122,7 @@ static int ipmi_open(struct inode *inode, struct file *file)
121 if (!priv) 122 if (!priv)
122 return -ENOMEM; 123 return -ENOMEM;
123 124
125 lock_kernel();
124 priv->file = file; 126 priv->file = file;
125 127
126 rv = ipmi_create_user(if_num, 128 rv = ipmi_create_user(if_num,
@@ -129,7 +131,7 @@ static int ipmi_open(struct inode *inode, struct file *file)
129 &(priv->user)); 131 &(priv->user));
130 if (rv) { 132 if (rv) {
131 kfree(priv); 133 kfree(priv);
132 return rv; 134 goto out;
133 } 135 }
134 136
135 file->private_data = priv; 137 file->private_data = priv;
@@ -144,7 +146,9 @@ static int ipmi_open(struct inode *inode, struct file *file)
144 priv->default_retries = -1; 146 priv->default_retries = -1;
145 priv->default_retry_time_ms = 0; 147 priv->default_retry_time_ms = 0;
146 148
147 return 0; 149out:
150 unlock_kernel();
151 return rv;
148} 152}
149 153
150static int ipmi_release(struct inode *inode, struct file *file) 154static int ipmi_release(struct inode *inode, struct file *file)