diff options
author | Pavel Emelyanov <xemul@parallels.com> | 2010-11-08 06:20:50 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-11-08 12:17:09 -0800 |
commit | aa58163a76a3aef33c7220931543d45d0fe43753 (patch) | |
tree | c88b5f62863053a83e7c9be1b978e1e44ff70f86 /net/rds | |
parent | 0cffef48ebf5060f749d8b04ab0437a4ba009e77 (diff) | |
download | kernel_samsung_espresso10-aa58163a76a3aef33c7220931543d45d0fe43753.zip kernel_samsung_espresso10-aa58163a76a3aef33c7220931543d45d0fe43753.tar.gz kernel_samsung_espresso10-aa58163a76a3aef33c7220931543d45d0fe43753.tar.bz2 |
rds: Fix rds message leak in rds_message_map_pages
The sgs allocation error path leaks the allocated message.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Andy Grover <andy.grover@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/rds')
-rw-r--r-- | net/rds/message.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/net/rds/message.c b/net/rds/message.c index 848cff4..1fd3d29 100644 --- 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], |