Skip to content

Commit e05e9f7

Browse files
Alan-Coxtorvalds
authored andcommitted
ixj: push BKL into driver and wrap ioctls
Signed-off-by: Alan Cox <alan@redhat.com> Cc: Nishanth Aravamudan <nacc@us.ibm.com> Cc: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 11af747 commit e05e9f7

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

‎drivers/telephony/ixj.c‎

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6095,15 +6095,15 @@ static int capabilities_check(IXJ *j, struct phone_capability *pcreq)
60956095
return retval;
60966096
}
60976097

6098-
static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd, unsigned long arg)
6098+
static long do_ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long arg)
60996099
{
61006100
IXJ_TONE ti;
61016101
IXJ_FILTER jf;
61026102
IXJ_FILTER_RAW jfr;
61036103
void __user *argp = (void __user *)arg;
6104-
6105-
unsigned int raise, mant;
6104+
struct inode *inode = file_p->f_path.dentry->d_inode;
61066105
unsigned int minor = iminor(inode);
6106+
unsigned int raise, mant;
61076107
int board = NUM(inode);
61086108

61096109
IXJ *j = get_ixj(NUM(inode));
@@ -6661,6 +6661,15 @@ static int ixj_ioctl(struct inode *inode, struct file *file_p, unsigned int cmd,
66616661
return retval;
66626662
}
66636663

6664+
static long ixj_ioctl(struct file *file_p, unsigned int cmd, unsigned long arg)
6665+
{
6666+
long ret;
6667+
lock_kernel();
6668+
ret = do_ixj_ioctl(file_p, cmd, arg);
6669+
unlock_kernel();
6670+
return ret;
6671+
}
6672+
66646673
static int ixj_fasync(int fd, struct file *file_p, int mode)
66656674
{
66666675
IXJ *j = get_ixj(NUM(file_p->f_path.dentry->d_inode));
@@ -6674,7 +6683,7 @@ static const struct file_operations ixj_fops =
66746683
.read = ixj_enhanced_read,
66756684
.write = ixj_enhanced_write,
66766685
.poll = ixj_poll,
6677-
.ioctl = ixj_ioctl,
6686+
.unlocked_ioctl = ixj_ioctl,
66786687
.release = ixj_release,
66796688
.fasync = ixj_fasync
66806689
};

0 commit comments

Comments
 (0)