Commit 3ac26b2ee30005930117fe6a180c139c5f300faf

Authored by Stefan Richter
1 parent 5da3dac8d9

firewire: cdev: mark char device files as not seekable

The <linux/firewire-cdev.h> character device file ABI (i.e. /dev/fw*
character device file interface) does not make any use of lseek(),
pread(), pwrite() (or any kind of write() at all).

Use nonseekable_open() and, redundantly, set file_operations.llseek to
no_llseek to remove any doubt whether the BKL-grabbing default_llseek
handler is used.  (Also shuffle file_operations initialization according
to the order of handler definitions.)

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>

Showing 1 changed file with 4 additions and 4 deletions Side-by-side Diff

drivers/firewire/core-cdev.c
... ... @@ -226,7 +226,7 @@
226 226 list_add_tail(&client->link, &device->client_list);
227 227 mutex_unlock(&device->client_list_mutex);
228 228  
229   - return 0;
  229 + return nonseekable_open(inode, file);
230 230 }
231 231  
232 232 static void queue_event(struct client *client, struct event *event,
233 233  
234 234  
... ... @@ -1495,13 +1495,13 @@
1495 1495  
1496 1496 const struct file_operations fw_device_ops = {
1497 1497 .owner = THIS_MODULE,
  1498 + .llseek = no_llseek,
1498 1499 .open = fw_device_op_open,
1499 1500 .read = fw_device_op_read,
1500 1501 .unlocked_ioctl = fw_device_op_ioctl,
1501   - .poll = fw_device_op_poll,
1502   - .release = fw_device_op_release,
1503 1502 .mmap = fw_device_op_mmap,
1504   -
  1503 + .release = fw_device_op_release,
  1504 + .poll = fw_device_op_poll,
1505 1505 #ifdef CONFIG_COMPAT
1506 1506 .compat_ioctl = fw_device_op_compat_ioctl,
1507 1507 #endif