mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:02:20 +00:00
atm: clean up a put_user() calls
Unlike copy_from_user(), put_user() and get_user() return -EFAULT on error. Use the error code directly instead of setting it. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/04a018e8-7433-4f67-8ddd-9357a0114f87@moroto.mountain Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
6a21fb7a9e
commit
afc5625e20
@ -68,7 +68,7 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
|
|||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
error = put_user(sk->sk_sndbuf - sk_wmem_alloc_get(sk),
|
error = put_user(sk->sk_sndbuf - sk_wmem_alloc_get(sk),
|
||||||
(int __user *)argp) ? -EFAULT : 0;
|
(int __user *)argp);
|
||||||
goto done;
|
goto done;
|
||||||
case SIOCINQ:
|
case SIOCINQ:
|
||||||
{
|
{
|
||||||
@ -83,7 +83,7 @@ static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
|
|||||||
skb = skb_peek(&sk->sk_receive_queue);
|
skb = skb_peek(&sk->sk_receive_queue);
|
||||||
amount = skb ? skb->len : 0;
|
amount = skb ? skb->len : 0;
|
||||||
spin_unlock_irq(&sk->sk_receive_queue.lock);
|
spin_unlock_irq(&sk->sk_receive_queue.lock);
|
||||||
error = put_user(amount, (int __user *)argp) ? -EFAULT : 0;
|
error = put_user(amount, (int __user *)argp);
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
case ATM_SETSC:
|
case ATM_SETSC:
|
||||||
|
Loading…
Reference in New Issue
Block a user