Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 219180
b: refs/heads/master
c: e4e62b3
h: refs/heads/master
v: v3
  • Loading branch information
Arnd Bergmann authored and Mauro Carvalho Chehab committed Oct 21, 2010
1 parent 7d682a1 commit a9d5073
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 41 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 634c6931637093f012df56d489e0b2f7735c235f
refs/heads/master: e4e62b35b8cf008f47ffd240d04bde654d289a46
17 changes: 2 additions & 15 deletions trunk/drivers/media/dvb/dvb-core/dmxdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/slab.h>
#include <linux/vmalloc.h>
#include <linux/module.h>
#include <linux/smp_lock.h>
#include <linux/poll.h>
#include <linux/ioctl.h>
#include <linux/wait.h>
Expand Down Expand Up @@ -1088,13 +1087,7 @@ static int dvb_demux_do_ioctl(struct file *file,
static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
unsigned long arg)
{
int ret;

lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
unlock_kernel();

return ret;
return dvb_usercopy(file, cmd, arg, dvb_demux_do_ioctl);
}

static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
Expand Down Expand Up @@ -1186,13 +1179,7 @@ static int dvb_dvr_do_ioctl(struct file *file,
static long dvb_dvr_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
unlock_kernel();

return ret;
return dvb_usercopy(file, cmd, arg, dvb_dvr_do_ioctl);
}

static unsigned int dvb_dvr_poll(struct file *file, poll_table *wait)
Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/media/dvb/dvb-core/dvb_ca_en50221.c
Original file line number Diff line number Diff line change
Expand Up @@ -1259,13 +1259,7 @@ static int dvb_ca_en50221_io_do_ioctl(struct file *file,
static long dvb_ca_en50221_io_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
unlock_kernel();

return ret;
return dvb_usercopy(file, cmd, arg, dvb_ca_en50221_io_do_ioctl);
}


Expand Down
9 changes: 1 addition & 8 deletions trunk/drivers/media/dvb/dvb-core/dvb_net.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/dvb/net.h>
#include <linux/smp_lock.h>
#include <linux/uio.h>
#include <asm/uaccess.h>
#include <linux/crc32.h>
Expand Down Expand Up @@ -1445,13 +1444,7 @@ static int dvb_net_do_ioctl(struct file *file,
static long dvb_net_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
int ret;

lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
unlock_kernel();

return ret;
return dvb_usercopy(file, cmd, arg, dvb_net_do_ioctl);
}

static int dvb_net_close(struct inode *inode, struct file *file)
Expand Down
17 changes: 7 additions & 10 deletions trunk/drivers/media/dvb/dvb-core/dvbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
#include <linux/fs.h>
#include <linux/cdev.h>
#include <linux/mutex.h>
#include <linux/smp_lock.h>
#include "dvbdev.h"

static DEFINE_MUTEX(dvbdev_mutex);
static int dvbdev_debug;

module_param(dvbdev_debug, int, 0644);
Expand Down Expand Up @@ -68,7 +68,7 @@ static int dvb_device_open(struct inode *inode, struct file *file)
{
struct dvb_device *dvbdev;

lock_kernel();
mutex_lock(&dvbdev_mutex);
down_read(&minor_rwsem);
dvbdev = dvb_minors[iminor(inode)];

Expand All @@ -91,12 +91,12 @@ static int dvb_device_open(struct inode *inode, struct file *file)
}
fops_put(old_fops);
up_read(&minor_rwsem);
unlock_kernel();
mutex_unlock(&dvbdev_mutex);
return err;
}
fail:
up_read(&minor_rwsem);
unlock_kernel();
mutex_unlock(&dvbdev_mutex);
return -ENODEV;
}

Expand Down Expand Up @@ -158,19 +158,14 @@ long dvb_generic_ioctl(struct file *file,
unsigned int cmd, unsigned long arg)
{
struct dvb_device *dvbdev = file->private_data;
int ret;

if (!dvbdev)
return -ENODEV;

if (!dvbdev->kernel_ioctl)
return -EINVAL;

lock_kernel();
ret = dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
unlock_kernel();

return ret;
return dvb_usercopy(file, cmd, arg, dvbdev->kernel_ioctl);
}
EXPORT_SYMBOL(dvb_generic_ioctl);

Expand Down Expand Up @@ -421,8 +416,10 @@ int dvb_usercopy(struct file *file,
}

/* call driver */
mutex_lock(&dvbdev_mutex);
if ((err = func(file, cmd, parg)) == -ENOIOCTLCMD)
err = -EINVAL;
mutex_unlock(&dvbdev_mutex);

if (err < 0)
goto out;
Expand Down

0 comments on commit a9d5073

Please sign in to comment.