+ dm-fix-memory-leak-in-dm_create_persistent-when-starting-metadata-update-thread-fails.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     dm: fix memory leak in dm_create_persistent() when starting metadata update thread fails
has been added to the -mm tree.  Its filename is
     dm-fix-memory-leak-in-dm_create_persistent-when-starting-metadata-update-thread-fails.patch

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find
out what to do about this

------------------------------------------------------
Subject: dm: fix memory leak in dm_create_persistent() when starting metadata update thread fails
From: Jesper Juhl <jesper.juhl@xxxxxxxxx>

If, in dm_create_persistent(), the call to create_singlethread_workqueue()
fails then we'll return without freeing the memory allocated to 'ps', thus
leaking sizeof(struct pstore) bytes.  This patch fixes the leak.

Signed-off-by: Jesper Juhl <jesper.juhl@xxxxxxxxx
Cc: Alasdair G Kergon <agk@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/md/dm-exception-store.c |    1 +
 1 files changed, 1 insertion(+)

diff -puN drivers/md/dm-exception-store.c~dm-fix-memory-leak-in-dm_create_persistent-when-starting-metadata-update-thread-fails drivers/md/dm-exception-store.c
--- a/drivers/md/dm-exception-store.c~dm-fix-memory-leak-in-dm_create_persistent-when-starting-metadata-update-thread-fails
+++ a/drivers/md/dm-exception-store.c
@@ -623,6 +623,7 @@ int dm_create_persistent(struct exceptio
 
 	ps->metadata_wq = create_singlethread_workqueue("ksnaphd");
 	if (!ps->metadata_wq) {
+		kfree(ps);
 		DMERR("couldn't start header metadata update thread");
 		return -ENOMEM;
 	}
_

Patches currently in -mm which might be from jesper.juhl@xxxxxxxxx are

origin.patch
dm-fix-memory-leak-in-dm_create_persistent-when-starting-metadata-update-thread-fails.patch
git-mtd.patch
remove-unneeded-test-of-task-in-dump_trace.patch
git-xfs.patch

-
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux