i2o: fasync BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Thu, 19 Jun 2008 21:44:57 +0000 (15:44 -0600)
committerJonathan Corbet <corbet@lwn.net>
Wed, 2 Jul 2008 21:06:27 +0000 (15:06 -0600)
This driver appears to really need the BKL to protect open_files.

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/message/i2o/i2o_config.c

index 95b4c10..4238de9 100644 (file)
@@ -1084,15 +1084,17 @@ static int cfg_fasync(int fd, struct file *fp, int on)
 {
        ulong id = (ulong) fp->private_data;
        struct i2o_cfg_info *p;
+       int ret = -EBADF;
 
+       lock_kernel();
        for (p = open_files; p; p = p->next)
                if (p->q_id == id)
                        break;
 
-       if (!p)
-               return -EBADF;
-
-       return fasync_helper(fd, fp, on, &p->fasync);
+       if (p)
+               ret = fasync_helper(fd, fp, on, &p->fasync);
+       unlock_kernel();
+       return ret;
 }
 
 static int cfg_release(struct inode *inode, struct file *file)