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:
0cffef4
)
rds: Fix rds message leak in rds_message_map_pages
author
Pavel Emelyanov
<
[email protected]
>
Mon, 8 Nov 2010 06:20:50 +0000
(06:20 +0000)
committer
David S. Miller
<
[email protected]
>
Mon, 8 Nov 2010 20:17:09 +0000
(12:17 -0800)
The sgs allocation error path leaks the allocated message.
Signed-off-by: Pavel Emelyanov <
[email protected]
>
Acked-by: Andy Grover <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/rds/message.c
patch
|
blob
|
history
diff --git
a/net/rds/message.c
b/net/rds/message.c
index 848cff45183bb3ef9fc52864c952cba3903b17c3..1fd3d29023d7684d524cff00a2da35b2eb03b2b4 100644
(file)
--- a/
net/rds/message.c
+++ b/
net/rds/message.c
@@
-249,8
+249,10
@@
struct rds_message *rds_message_map_pages(unsigned long *page_addrs, unsigned in
rm->m_inc.i_hdr.h_len = cpu_to_be32(total_len);
rm->data.op_nents = ceil(total_len, PAGE_SIZE);
rm->data.op_sg = rds_message_alloc_sgs(rm, num_sgs);
- if (!rm->data.op_sg)
+ if (!rm->data.op_sg) {
+ rds_message_put(rm);
return ERR_PTR(-ENOMEM);
+ }
for (i = 0; i < rm->data.op_nents; ++i) {
sg_set_page(&rm->data.op_sg[i],