diff options
author | Masatake YAMATO <yamato@redhat.com> | 2008-05-28 01:45:10 -0400 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2008-07-14 14:56:59 -0400 |
commit | 254ae43ab8d7877c980fca3636624e0777a70fa4 (patch) | |
tree | 2a68101ba1c053d167a3f5effed6c33ab1043972 | |
parent | bce7f793daec3e65ec5c5705d2457b81fe7b5725 (diff) |
dlm: check for null in device_write
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>
-rw-r--r-- | fs/dlm/user.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/dlm/user.c b/fs/dlm/user.c index ebbcf38fd33b..1aa76b32d056 100644 --- a/fs/dlm/user.c +++ b/fs/dlm/user.c | |||
@@ -538,7 +538,7 @@ static ssize_t device_write(struct file *file, const char __user *buf, | |||
538 | 538 | ||
539 | /* do we really need this? can a write happen after a close? */ | 539 | /* do we really need this? can a write happen after a close? */ |
540 | if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && | 540 | if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && |
541 | test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)) | 541 | (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) |
542 | return -EINVAL; | 542 | return -EINVAL; |
543 | 543 | ||
544 | sigfillset(&allsigs); | 544 | sigfillset(&allsigs); |