Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Marek Belisko and committed by
Greg Kroah-Hartman
91cda632 0ce72ea3

+3 -5
+3 -5
drivers/staging/ft1000/ft1000-usb/ft1000_debug.c
··· 174 174 } 175 175 176 176 file = debugfs_create_file("device", S_IRUGO | S_IWUSR, dir, 177 - NULL, &ft1000fops); 177 + dev, &ft1000fops); 178 178 if (IS_ERR(file)) { 179 179 result = PTR_ERR(file); 180 180 goto debug_file_fail; ··· 398 398 unsigned long argument) 399 399 { 400 400 void __user *argp = (void __user *)argument; 401 - struct net_device *dev; 402 401 struct ft1000_info *info; 403 402 struct ft1000_device *ft1000dev; 404 403 int result=0; ··· 427 428 428 429 //DEBUG("FT1000:ft1000_ioctl:command = 0x%x argument = 0x%8x\n", command, (u32)argument); 429 430 430 - dev = file->private_data; 431 - info = netdev_priv(dev); 432 - ft1000dev = info->pFt1000Dev; 431 + info = file->private_data; 432 + ft1000dev = info->pFt1000Dev; 433 433 cmd = _IOC_NR(command); 434 434 //DEBUG("FT1000:ft1000_ioctl:cmd = 0x%x\n", cmd); 435 435