diff options
Diffstat (limited to 'drivers/isdn/mISDN/socket.c')
-rw-r--r-- | drivers/isdn/mISDN/socket.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/isdn/mISDN/socket.c b/drivers/isdn/mISDN/socket.c index 508945d1b9c1..530f68977361 100644 --- a/drivers/isdn/mISDN/socket.c +++ b/drivers/isdn/mISDN/socket.c | |||
@@ -292,7 +292,7 @@ static int | |||
292 | data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) | 292 | data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) |
293 | { | 293 | { |
294 | struct mISDN_ctrl_req cq; | 294 | struct mISDN_ctrl_req cq; |
295 | int err = -EINVAL, val; | 295 | int err = -EINVAL, val[2]; |
296 | struct mISDNchannel *bchan, *next; | 296 | struct mISDNchannel *bchan, *next; |
297 | 297 | ||
298 | lock_sock(sk); | 298 | lock_sock(sk); |
@@ -328,12 +328,27 @@ data_sock_ioctl_bound(struct sock *sk, unsigned int cmd, void __user *p) | |||
328 | err = -EINVAL; | 328 | err = -EINVAL; |
329 | break; | 329 | break; |
330 | } | 330 | } |
331 | if (get_user(val, (int __user *)p)) { | 331 | val[0] = cmd; |
332 | if (get_user(val[1], (int __user *)p)) { | ||
332 | err = -EFAULT; | 333 | err = -EFAULT; |
333 | break; | 334 | break; |
334 | } | 335 | } |
335 | err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, | 336 | err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, |
336 | CONTROL_CHANNEL, &val); | 337 | CONTROL_CHANNEL, val); |
338 | break; | ||
339 | case IMHOLD_L1: | ||
340 | if (sk->sk_protocol != ISDN_P_LAPD_NT | ||
341 | && sk->sk_protocol != ISDN_P_LAPD_TE) { | ||
342 | err = -EINVAL; | ||
343 | break; | ||
344 | } | ||
345 | val[0] = cmd; | ||
346 | if (get_user(val[1], (int __user *)p)) { | ||
347 | err = -EFAULT; | ||
348 | break; | ||
349 | } | ||
350 | err = _pms(sk)->dev->teimgr->ctrl(_pms(sk)->dev->teimgr, | ||
351 | CONTROL_CHANNEL, val); | ||
337 | break; | 352 | break; |
338 | default: | 353 | default: |
339 | err = -EINVAL; | 354 | err = -EINVAL; |