]> err.no Git - linux-2.6/commitdiff
dlm: check for null in device_write
authorMasatake YAMATO <yamato@redhat.com>
Wed, 28 May 2008 05:45:10 +0000 (14:45 +0900)
committerDavid Teigland <teigland@redhat.com>
Mon, 14 Jul 2008 18:56:59 +0000 (13:56 -0500)
If `device_write' method is called via "dlm-control",
file->private_data is NULL. (See ctl_device_open() in
user.c. ) Through proc->flags is read.

Signed-off-by: Masatake YAMATO <yamato@redhat.com>
Signed-off-by: David Teigland <teigland@redhat.com>
fs/dlm/user.c

index ebbcf38fd33b098143d04e0b575b7028905fd45e..1aa76b32d05690a4a0ad7000eb805799a924a3dd 100644 (file)
@@ -538,7 +538,7 @@ static ssize_t device_write(struct file *file, const char __user *buf,
 
        /* do we really need this? can a write happen after a close? */
        if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) &&
-           test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))
+           (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)))
                return -EINVAL;
 
        sigfillset(&allsigs);