aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firewire
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firewire')
-rw-r--r--drivers/firewire/core-cdev.c17
1 files changed, 5 insertions, 12 deletions
diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c
index d7de17a0f250..8be720b278b7 100644
--- a/drivers/firewire/core-cdev.c
+++ b/drivers/firewire/core-cdev.c
@@ -1349,6 +1349,9 @@ static int dispatch_ioctl(struct client *client,
1349 union ioctl_arg buffer; 1349 union ioctl_arg buffer;
1350 int ret; 1350 int ret;
1351 1351
1352 if (fw_device_is_shutdown(client->device))
1353 return -ENODEV;
1354
1352 if (_IOC_TYPE(cmd) != '#' || 1355 if (_IOC_TYPE(cmd) != '#' ||
1353 _IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers)) 1356 _IOC_NR(cmd) >= ARRAY_SIZE(ioctl_handlers))
1354 return -EINVAL; 1357 return -EINVAL;
@@ -1375,24 +1378,14 @@ static int dispatch_ioctl(struct client *client,
1375static long fw_device_op_ioctl(struct file *file, 1378static long fw_device_op_ioctl(struct file *file,
1376 unsigned int cmd, unsigned long arg) 1379 unsigned int cmd, unsigned long arg)
1377{ 1380{
1378 struct client *client = file->private_data; 1381 return dispatch_ioctl(file->private_data, cmd, (void __user *)arg);
1379
1380 if (fw_device_is_shutdown(client->device))
1381 return -ENODEV;
1382
1383 return dispatch_ioctl(client, cmd, (void __user *) arg);
1384} 1382}
1385 1383
1386#ifdef CONFIG_COMPAT 1384#ifdef CONFIG_COMPAT
1387static long fw_device_op_compat_ioctl(struct file *file, 1385static long fw_device_op_compat_ioctl(struct file *file,
1388 unsigned int cmd, unsigned long arg) 1386 unsigned int cmd, unsigned long arg)
1389{ 1387{
1390 struct client *client = file->private_data; 1388 return dispatch_ioctl(file->private_data, cmd, compat_ptr(arg));
1391
1392 if (fw_device_is_shutdown(client->device))
1393 return -ENODEV;
1394
1395 return dispatch_ioctl(client, cmd, compat_ptr(arg));
1396} 1389}
1397#endif 1390#endif
1398 1391