aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging
diff options
context:
space:
mode:
authorMarek Belisko <marek.belisko@open-nandra.com>2010-12-14 14:02:55 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2010-12-16 12:20:05 -0800
commit91cda632ebc6ea84fd7a45efb6d4452c34985731 (patch)
tree9963aa208237c01e7b7e5ffad477c5917147e154 /drivers/staging
parentstaging: ft1000: Fix camelcase variable names. (diff)
downloadlinux-dev-91cda632ebc6ea84fd7a45efb6d4452c34985731.tar.xz
linux-dev-91cda632ebc6ea84fd7a45efb6d4452c34985731.zip
staging: ft1000: Fix kernel panic when use ioctl.
During ioctl testing was observed kernel panic beuase file->private_data pointer was not correctly set when debugfs file was created. Add correct pointer setup. Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/ft1000/ft1000-usb/ft1000_debug.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
index e39809229d46..149ba59f96bf 100644
--- a/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
+++ b/drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
@@ -174,7 +174,7 @@ int ft1000_create_dev(struct ft1000_device *dev)
}
file = debugfs_create_file("device", S_IRUGO | S_IWUSR, dir,
- NULL, &ft1000fops);
+ dev, &ft1000fops);
if (IS_ERR(file)) {
result = PTR_ERR(file);
goto debug_file_fail;
@@ -398,7 +398,6 @@ static long ft1000_ioctl (struct file *file, unsigned int command,
unsigned long argument)
{
void __user *argp = (void __user *)argument;
- struct net_device *dev;
struct ft1000_info *info;
struct ft1000_device *ft1000dev;
int result=0;
@@ -428,9 +427,8 @@ static long ft1000_ioctl (struct file *file, unsigned int command,
//DEBUG("FT1000:ft1000_ioctl:command = 0x%x argument = 0x%8x\n", command, (u32)argument);
- dev = file->private_data;
- info = netdev_priv(dev);
- ft1000dev = info->pFt1000Dev;
+ info = file->private_data;
+ ft1000dev = info->pFt1000Dev;
cmd = _IOC_NR(command);
//DEBUG("FT1000:ft1000_ioctl:cmd = 0x%x\n", cmd);