* [PATCH] rds: Fix rds message leak in rds_message_map_pages
@ 2010-11-08 16:20 Pavel Emelyanov
2010-11-08 19:40 ` Andy Grover
0 siblings, 1 reply; 3+ messages in thread
From: Pavel Emelyanov @ 2010-11-08 16:20 UTC (permalink / raw)
To: Andy Grover, David Miller; +Cc: rds-devel, Linux Netdev List
The sgs allocation error path leaks the allocated message.
Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
---
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],
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] rds: Fix rds message leak in rds_message_map_pages
2010-11-08 16:20 [PATCH] rds: Fix rds message leak in rds_message_map_pages Pavel Emelyanov
@ 2010-11-08 19:40 ` Andy Grover
2010-11-08 20:20 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Andy Grover @ 2010-11-08 19:40 UTC (permalink / raw)
To: Pavel Emelyanov; +Cc: David Miller, rds-devel, Linux Netdev List
On 11/08/2010 08:20 AM, Pavel Emelyanov wrote:
> The sgs allocation error path leaks the allocated message.
>
> Signed-off-by: Pavel Emelyanov<xemul@openvz.org>
>
> ---
>
> 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],
Acked-by: Andy Grover <andy.grover@oracle.com>
-- Andy
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] rds: Fix rds message leak in rds_message_map_pages
2010-11-08 19:40 ` Andy Grover
@ 2010-11-08 20:20 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2010-11-08 20:20 UTC (permalink / raw)
To: andy.grover; +Cc: xemul, rds-devel, netdev
From: Andy Grover <andy.grover@oracle.com>
Date: Mon, 08 Nov 2010 11:40:53 -0800
> On 11/08/2010 08:20 AM, Pavel Emelyanov wrote:
>> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-11-08 20:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-08 16:20 [PATCH] rds: Fix rds message leak in rds_message_map_pages Pavel Emelyanov
2010-11-08 19:40 ` Andy Grover
2010-11-08 20:20 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.