projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
07968fe
)
kfifo: kfifo_copy_{to,from}_user: fix copied bytes calculation
author
Lars-Peter Clausen
<
[email protected]
>
Thu, 14 Nov 2013 22:32:16 +0000
(14:32 -0800)
committer
Linus Torvalds
<
[email protected]
>
Fri, 15 Nov 2013 00:32:23 +0000
(09:32 +0900)
'copied' and 'len' are in bytes, while 'ret' is in elements, so we need to
multiply 'ret' with the size of one element to get the correct result.
Signed-off-by: Lars-Peter Clausen <
[email protected]
>
Cc: Stefani Seibold <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
lib/kfifo.c
patch
|
blob
|
history
diff --git
a/lib/kfifo.c
b/lib/kfifo.c
index 7b7f83027b7b748a4a1497d7804d4b54077d0790..d79b9d222065bd9467e4e091ad850a2ce4d93c94 100644
(file)
--- a/
lib/kfifo.c
+++ b/
lib/kfifo.c
@@
-215,7
+215,7
@@
static unsigned long kfifo_copy_from_user(struct __kfifo *fifo,
* incrementing the fifo->in index counter
*/
smp_wmb();
- *copied = len - ret;
+ *copied = len - ret
* esize
;
/* return the number of elements which are not copied */
return ret;
}
@@
-275,7
+275,7
@@
static unsigned long kfifo_copy_to_user(struct __kfifo *fifo, void __user *to,
* incrementing the fifo->out index counter
*/
smp_wmb();
- *copied = len - ret;
+ *copied = len - ret
* esize
;
/* return the number of elements which are not copied */
return ret;
}