提交 254ae43a 编写于 作者: M Masatake YAMATO 提交者: David Teigland

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: NMasatake YAMATO <yamato@redhat.com>
Signed-off-by: NDavid Teigland <teigland@redhat.com>
上级 bce7f793
...@@ -538,7 +538,7 @@ static ssize_t device_write(struct file *file, const char __user *buf, ...@@ -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? */ /* do we really need this? can a write happen after a close? */
if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && 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; return -EINVAL;
sigfillset(&allsigs); sigfillset(&allsigs);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册