Skip to content

Commit

Permalink
dlm: check for null in device_write
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Masatake YAMATO authored and David Teigland committed Jul 14, 2008
1 parent bce7f79 commit 254ae43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/dlm/user.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 254ae43

Please sign in to comment.