ipmi: fasync BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Mon, 23 Jun 2008 23:00:14 +0000 (17:00 -0600)
committerJonathan Corbet <corbet@lwn.net>
Wed, 2 Jul 2008 21:06:28 +0000 (15:06 -0600)
This driver really needs it to avoid races against open()

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/char/ipmi/ipmi_devintf.c

index c816656d6bfbf444f9b14bc81614b211e3c51f76..c11a40483459f3bd581dd5429f65606b1d882f67 100644 (file)
@@ -101,7 +101,9 @@ static int ipmi_fasync(int fd, struct file *file, int on)
        struct ipmi_file_private *priv = file->private_data;
        int                      result;
 
+       lock_kernel(); /* could race against open() otherwise */
        result = fasync_helper(fd, file, on, &priv->fasync_queue);
+       unlock_kernel();
 
        return (result);
 }