aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index 8cfc419cef4b..ad96ee90fe27 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1562,19 +1562,20 @@ out_dtefac_release:
1562 case SIOCX25SCUDMATCHLEN: { 1562 case SIOCX25SCUDMATCHLEN: {
1563 struct x25_subaddr sub_addr; 1563 struct x25_subaddr sub_addr;
1564 rc = -EINVAL; 1564 rc = -EINVAL;
1565 lock_kernel(); 1565 lock_sock(sk);
1566 if(sk->sk_state != TCP_CLOSE) 1566 if(sk->sk_state != TCP_CLOSE)
1567 break; 1567 goto out_cud_release;
1568 rc = -EFAULT; 1568 rc = -EFAULT;
1569 if (copy_from_user(&sub_addr, argp, 1569 if (copy_from_user(&sub_addr, argp,
1570 sizeof(sub_addr))) 1570 sizeof(sub_addr)))
1571 break; 1571 goto out_cud_release;
1572 rc = -EINVAL; 1572 rc = -EINVAL;
1573 if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN) 1573 if(sub_addr.cudmatchlength > X25_MAX_CUD_LEN)
1574 break; 1574 goto out_cud_release;
1575 x25->cudmatchlength = sub_addr.cudmatchlength; 1575 x25->cudmatchlength = sub_addr.cudmatchlength;
1576 unlock_kernel();
1577 rc = 0; 1576 rc = 0;
1577out_cud_release:
1578 release_sock(sk);
1578 break; 1579 break;
1579 } 1580 }
1580 1581