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>

authored by

Masatake YAMATO and committed by
David Teigland
254ae43a bce7f793

+1 -1
+1 -1
fs/dlm/user.c
··· 538 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) && 541 - test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)) 542 return -EINVAL; 543 544 sigfillset(&allsigs);
··· 538 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) && 541 + (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) 542 return -EINVAL; 543 544 sigfillset(&allsigs);