All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak
@ 2008-11-26  0:01 Takahiro Yasui
  2008-12-16 16:57 ` Jonathan Brassow
  0 siblings, 1 reply; 2+ messages in thread
From: Takahiro Yasui @ 2008-11-26  0:01 UTC (permalink / raw)
  To: dm-devel; +Cc: Alasdair G Kergon, Masami Hiramatsu

In create_log_context function, dm_io_client_destroy function needs
to be called, when memory allocation of disk_header, sync_bits and
recovering_bits failed, but dm_io_client_destroy is not called.
This patch fixes it.


Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
---
 drivers/md/dm-log.c |    5 +++++
 1 file changed, 5 insertions(+)

Index: linux-2.6.28-rc4/drivers/md/dm-log.c
===================================================================
--- linux-2.6.28-rc4.orig/drivers/md/dm-log.c
+++ linux-2.6.28-rc4/drivers/md/dm-log.c
@@ -467,6 +467,7 @@ static int create_log_context(struct dm_
 		lc->disk_header = vmalloc(buf_size);
 		if (!lc->disk_header) {
 			DMWARN("couldn't allocate disk log buffer");
+			dm_io_client_destroy(lc->io_req.client);
 			kfree(lc);
 			return -ENOMEM;
 		}
@@ -483,6 +484,8 @@ static int create_log_context(struct dm_
 		if (!dev)
 			vfree(lc->clean_bits);
 		vfree(lc->disk_header);
+		if (dev)
+			dm_io_client_destroy(lc->io_req.client);
 		kfree(lc);
 		return -ENOMEM;
 	}
@@ -496,6 +499,8 @@ static int create_log_context(struct dm_
 		if (!dev)
 			vfree(lc->clean_bits);
 		vfree(lc->disk_header);
+		if (dev)
+			dm_io_client_destroy(lc->io_req.client);
 		kfree(lc);
 		return -ENOMEM;
 	}

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak
  2008-11-26  0:01 [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak Takahiro Yasui
@ 2008-12-16 16:57 ` Jonathan Brassow
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Brassow @ 2008-12-16 16:57 UTC (permalink / raw)
  To: device-mapper development

ACK - reviewed but not tested.

  brassow

On Nov 25, 2008, at 6:01 PM, Takahiro Yasui wrote:

> In create_log_context function, dm_io_client_destroy function needs
> to be called, when memory allocation of disk_header, sync_bits and
> recovering_bits failed, but dm_io_client_destroy is not called.
> This patch fixes it.
>
>
> Signed-off-by: Takahiro Yasui <tyasui@redhat.com>
> ---
> drivers/md/dm-log.c |    5 +++++
> 1 file changed, 5 insertions(+)
>
> Index: linux-2.6.28-rc4/drivers/md/dm-log.c
> ===================================================================
> --- linux-2.6.28-rc4.orig/drivers/md/dm-log.c
> +++ linux-2.6.28-rc4/drivers/md/dm-log.c
> @@ -467,6 +467,7 @@ static int create_log_context(struct dm_
> 		lc->disk_header = vmalloc(buf_size);
> 		if (!lc->disk_header) {
> 			DMWARN("couldn't allocate disk log buffer");
> +			dm_io_client_destroy(lc->io_req.client);
> 			kfree(lc);
> 			return -ENOMEM;
> 		}
> @@ -483,6 +484,8 @@ static int create_log_context(struct dm_
> 		if (!dev)
> 			vfree(lc->clean_bits);
> 		vfree(lc->disk_header);
> +		if (dev)
> +			dm_io_client_destroy(lc->io_req.client);
> 		kfree(lc);
> 		return -ENOMEM;
> 	}
> @@ -496,6 +499,8 @@ static int create_log_context(struct dm_
> 		if (!dev)
> 			vfree(lc->clean_bits);
> 		vfree(lc->disk_header);
> +		if (dev)
> +			dm_io_client_destroy(lc->io_req.client);
> 		kfree(lc);
> 		return -ENOMEM;
> 	}
>
> --
> dm-devel mailing list
> dm-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/dm-devel

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-12-16 16:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-26  0:01 [RFC][PATCH 1/4] dm-log: fix io_client_destroy leak Takahiro Yasui
2008-12-16 16:57 ` Jonathan Brassow

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.