diff options
-rw-r--r-- | drivers/char/hpet.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c index e7fb0bca3667..fb0a85a1eb36 100644 --- a/drivers/char/hpet.c +++ b/drivers/char/hpet.c | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/smp_lock.h> | ||
17 | #include <linux/types.h> | 18 | #include <linux/types.h> |
18 | #include <linux/miscdevice.h> | 19 | #include <linux/miscdevice.h> |
19 | #include <linux/major.h> | 20 | #include <linux/major.h> |
@@ -193,6 +194,7 @@ static int hpet_open(struct inode *inode, struct file *file) | |||
193 | if (file->f_mode & FMODE_WRITE) | 194 | if (file->f_mode & FMODE_WRITE) |
194 | return -EINVAL; | 195 | return -EINVAL; |
195 | 196 | ||
197 | lock_kernel(); | ||
196 | spin_lock_irq(&hpet_lock); | 198 | spin_lock_irq(&hpet_lock); |
197 | 199 | ||
198 | for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) | 200 | for (devp = NULL, hpetp = hpets; hpetp && !devp; hpetp = hpetp->hp_next) |
@@ -207,6 +209,7 @@ static int hpet_open(struct inode *inode, struct file *file) | |||
207 | 209 | ||
208 | if (!devp) { | 210 | if (!devp) { |
209 | spin_unlock_irq(&hpet_lock); | 211 | spin_unlock_irq(&hpet_lock); |
212 | unlock_kernel(); | ||
210 | return -EBUSY; | 213 | return -EBUSY; |
211 | } | 214 | } |
212 | 215 | ||
@@ -214,6 +217,7 @@ static int hpet_open(struct inode *inode, struct file *file) | |||
214 | devp->hd_irqdata = 0; | 217 | devp->hd_irqdata = 0; |
215 | devp->hd_flags |= HPET_OPEN; | 218 | devp->hd_flags |= HPET_OPEN; |
216 | spin_unlock_irq(&hpet_lock); | 219 | spin_unlock_irq(&hpet_lock); |
220 | unlock_kernel(); | ||
217 | 221 | ||
218 | return 0; | 222 | return 0; |
219 | } | 223 | } |