aboutsummaryrefslogtreecommitdiffstats
path: root/net/x25
diff options
context:
space:
mode:
Diffstat (limited to 'net/x25')
-rw-r--r--net/x25/af_x25.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
index e2eea0aec46..8cfc419cef4 100644
--- a/net/x25/af_x25.c
+++ b/net/x25/af_x25.c
@@ -1538,23 +1538,22 @@ out_dtefac_release:
1538 } 1538 }
1539 1539
1540 case SIOCX25GCAUSEDIAG: { 1540 case SIOCX25GCAUSEDIAG: {
1541 struct x25_causediag causediag; 1541 lock_sock(sk);
1542 lock_kernel(); 1542 rc = copy_to_user(argp, &x25->causediag,
1543 causediag = x25->causediag; 1543 sizeof(x25->causediag))
1544 rc = copy_to_user(argp, &causediag, 1544 ? -EFAULT : 0;
1545 sizeof(causediag)) ? -EFAULT : 0; 1545 release_sock(sk);
1546 unlock_kernel();
1547 break; 1546 break;
1548 } 1547 }
1549 1548
1550 case SIOCX25SCAUSEDIAG: { 1549 case SIOCX25SCAUSEDIAG: {
1551 struct x25_causediag causediag; 1550 struct x25_causediag causediag;
1552 rc = -EFAULT; 1551 rc = -EFAULT;
1553 lock_kernel();
1554 if (copy_from_user(&causediag, argp, sizeof(causediag))) 1552 if (copy_from_user(&causediag, argp, sizeof(causediag)))
1555 break; 1553 break;
1554 lock_sock(sk);
1556 x25->causediag = causediag; 1555 x25->causediag = causediag;
1557 unlock_kernel(); 1556 release_sock(sk);
1558 rc = 0; 1557 rc = 0;
1559 break; 1558 break;
1560 1559