Skip to content

Commit

Permalink
phonedev: cdev lock_kernel() pushdown
Browse files Browse the repository at this point in the history
phone_open() looks OK, but I don't trust the subsidiary drivers (and ixj in
particular).

Signed-off-by: Jonathan Corbet <[email protected]>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 70ffa16 commit 16750c2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/telephony/phonedev.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <linux/errno.h>
#include <linux/phonedev.h>
#include <linux/init.h>
#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>

Expand Down Expand Up @@ -53,6 +54,7 @@ static int phone_open(struct inode *inode, struct file *file)
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;

lock_kernel();
mutex_lock(&phone_lock);
p = phone_device[minor];
if (p)
Expand All @@ -79,6 +81,7 @@ static int phone_open(struct inode *inode, struct file *file)
fops_put(old_fops);
end:
mutex_unlock(&phone_lock);
unlock_kernel();
return err;
}

Expand Down

0 comments on commit 16750c2

Please sign in to comment.