Skip to content

Commit 254ae43

Browse files
masataketeigland
authored andcommitted
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>
1 parent bce7f79 commit 254ae43

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/dlm/user.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ static ssize_t device_write(struct file *file, const char __user *buf,
538538

539539
/* do we really need this? can a write happen after a close? */
540540
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)))
542542
return -EINVAL;
543543

544544
sigfillset(&allsigs);

0 commit comments

Comments
 (0)