projects
/
linux-block.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6a21fb7
)
atm: clean up a put_user() calls
author
Dan Carpenter
<dan.carpenter@linaro.org>
Thu, 13 Jun 2024 18:21:42 +0000
(21:21 +0300)
committer
Jakub Kicinski
<kuba@kernel.org>
Sat, 15 Jun 2024 02:08:50 +0000
(19:08 -0700)
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>
net/atm/ioctl.c
patch
|
blob
|
blame
|
history
diff --git
a/net/atm/ioctl.c
b/net/atm/ioctl.c
index f81f8d56f5c0c574d60b7bb552c3cc62bca40f9e..0f7a39aeccc8ef54f5a1664c8ad3af4ebbbdd693 100644
(file)
--- a/
net/atm/ioctl.c
+++ b/
net/atm/ioctl.c
@@
-68,7
+68,7
@@
static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
goto done;
}
error = put_user(sk->sk_sndbuf - sk_wmem_alloc_get(sk),
- (int __user *)argp)
? -EFAULT : 0
;
+ (int __user *)argp);
goto done;
case SIOCINQ:
{
@@
-83,7
+83,7
@@
static int do_vcc_ioctl(struct socket *sock, unsigned int cmd,
skb = skb_peek(&sk->sk_receive_queue);
amount = skb ? skb->len : 0;
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;
}
case ATM_SETSC: