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

+7 -3
+3 -1
fs/dlm/lock.c
··· 363 if (len == r->res_length && !memcmp(name, r->res_name, len)) 364 goto found; 365 } 366 return -EBADR; 367 368 found: ··· 1783 1784 list_for_each_entry_safe(lkb, s, &r->res_grantqueue, lkb_statequeue) { 1785 if (lkb->lkb_bastfn && lock_requires_bast(lkb, high, cw)) { 1786 - if (cw && high == DLM_LOCK_PR) 1787 queue_bast(r, lkb, DLM_LOCK_CW); 1788 else 1789 queue_bast(r, lkb, high);
··· 363 if (len == r->res_length && !memcmp(name, r->res_name, len)) 364 goto found; 365 } 366 + *r_ret = NULL; 367 return -EBADR; 368 369 found: ··· 1782 1783 list_for_each_entry_safe(lkb, s, &r->res_grantqueue, lkb_statequeue) { 1784 if (lkb->lkb_bastfn && lock_requires_bast(lkb, high, cw)) { 1785 + if (cw && high == DLM_LOCK_PR && 1786 + lkb->lkb_grmode == DLM_LOCK_PR) 1787 queue_bast(r, lkb, DLM_LOCK_CW); 1788 else 1789 queue_bast(r, lkb, high);
+3 -1
fs/dlm/lowcomms.c
··· 891 goto out_err; 892 893 memset(&saddr, 0, sizeof(saddr)); 894 - if (dlm_nodeid_to_addr(con->nodeid, &saddr)) 895 goto out_err; 896 897 sock->sk->sk_user_data = con; 898 con->rx_action = receive_from_sock;
··· 891 goto out_err; 892 893 memset(&saddr, 0, sizeof(saddr)); 894 + if (dlm_nodeid_to_addr(con->nodeid, &saddr)) { 895 + sock_release(sock); 896 goto out_err; 897 + } 898 899 sock->sk->sk_user_data = con; 900 con->rx_action = receive_from_sock;
+1 -1
fs/dlm/user.c
··· 539 540 /* do we really need this? can a write happen after a close? */ 541 if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && 542 - test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags)) 543 return -EINVAL; 544 545 sigfillset(&allsigs);
··· 539 540 /* do we really need this? can a write happen after a close? */ 541 if ((kbuf->cmd == DLM_USER_LOCK || kbuf->cmd == DLM_USER_UNLOCK) && 542 + (proc && test_bit(DLM_PROC_FLAGS_CLOSING, &proc->flags))) 543 return -EINVAL; 544 545 sigfillset(&allsigs);