diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-15 12:46:49 -0400 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 16:05:47 -0400 |
commit | ecc38983f6c83f371fefb5a69a72e358fc7b1218 (patch) | |
tree | 86743fd4b4ab4b675e419326a897bbe95404fe42 /drivers/char/ipmi/ipmi_devintf.c | |
parent | fbc8a81d66bbbce3f0b4d5752f8bc8bb3c1fc439 (diff) |
ipmi: cdev lock_kernel() pushdown
Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers/char/ipmi/ipmi_devintf.c')
-rw-r--r-- | drivers/char/ipmi/ipmi_devintf.c | 8 |
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 | ||
47 | struct ipmi_file_private | 48 | struct 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; | 149 | out: |
150 | unlock_kernel(); | ||
151 | return rv; | ||
148 | } | 152 | } |
149 | 153 | ||
150 | static int ipmi_release(struct inode *inode, struct file *file) | 154 | static int ipmi_release(struct inode *inode, struct file *file) |