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:
234a426
)
net: use release_pages() in zerocopy_sg_from_iovec()
author
Jason Wang
<
[email protected]
>
Tue, 6 Aug 2013 09:45:07 +0000
(17:45 +0800)
committer
David S. Miller
<
[email protected]
>
Wed, 7 Aug 2013 23:52:38 +0000
(16:52 -0700)
To reduce the duplicated codes.
Signed-off-by: Jason Wang <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/core/datagram.c
patch
|
blob
|
history
diff --git
a/net/core/datagram.c
b/net/core/datagram.c
index a8a795cfeff5d968f96333f011cdbc2724ab835b..badcd93e5dd8275391a609715feb7c0d2eab35f6 100644
(file)
--- a/
net/core/datagram.c
+++ b/
net/core/datagram.c
@@
-48,6
+48,7
@@
#include <linux/highmem.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
+#include <linux/pagemap.h>
#include <net/protocol.h>
#include <linux/skbuff.h>
@@
-638,10
+639,7
@@
int zerocopy_sg_from_iovec(struct sk_buff *skb, const struct iovec *from,
return -EMSGSIZE;
num_pages = get_user_pages_fast(base, size, 0, &page[i]);
if (num_pages != size) {
- int j;
-
- for (j = 0; j < num_pages; j++)
- put_page(page[i + j]);
+ release_pages(&page[i], num_pages, 0);
return -EFAULT;
}
truesize = size * PAGE_SIZE;