Commit 3988ba07 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/teigland/dlm:
  dlm: fix uninitialized variable for search_rsb_list callers
  dlm: release socket on error
  dlm: fix basts for granted CW waiting PR/CW
  dlm: check for null in device_write
parents d9089c29 18c60c0a
...@@ -363,6 +363,7 @@ static int search_rsb_list(struct list_head *head, char *name, int len, ...@@ -363,6 +363,7 @@ static int search_rsb_list(struct list_head *head, char *name, int len,
if (len == r->res_length && !memcmp(name, r->res_name, len)) if (len == r->res_length && !memcmp(name, r->res_name, len))
goto found; goto found;
} }
*r_ret = NULL;
return -EBADR; return -EBADR;
found: found:
...@@ -1782,7 +1783,8 @@ static void grant_pending_locks(struct dlm_rsb *r) ...@@ -1782,7 +1783,8 @@ static void grant_pending_locks(struct dlm_rsb *r)
list_for_each_entry_safe(lkb, s, &r->res_grantqueue, lkb_statequeue) { list_for_each_entry_safe(lkb, s, &r->res_grantqueue, lkb_statequeue) {
if (lkb->lkb_bastfn && lock_requires_bast(lkb, high, cw)) { if (lkb->lkb_bastfn && lock_requires_bast(lkb, high, cw)) {
if (cw && high == DLM_LOCK_PR) if (cw && high == DLM_LOCK_PR &&
lkb->lkb_grmode == DLM_LOCK_PR)
queue_bast(r, lkb, DLM_LOCK_CW); queue_bast(r, lkb, DLM_LOCK_CW);
else else
queue_bast(r, lkb, high); queue_bast(r, lkb, high);
......
...@@ -891,8 +891,10 @@ static void tcp_connect_to_sock(struct connection *con) ...@@ -891,8 +891,10 @@ static void tcp_connect_to_sock(struct connection *con)
goto out_err; goto out_err;
memset(&saddr, 0, sizeof(saddr)); memset(&saddr, 0, sizeof(saddr));
if (dlm_nodeid_to_addr(con->nodeid, &saddr)) if (dlm_nodeid_to_addr(con->nodeid, &saddr)) {
sock_release(sock);
goto out_err; goto out_err;
}
sock->sk->sk_user_data = con; sock->sk->sk_user_data = con;
con->rx_action = receive_from_sock; con->rx_action = receive_from_sock;
......
...@@ -539,7 +539,7 @@ static ssize_t device_write(struct file *file, const char __user *buf, ...@@ -539,7 +539,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%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment