Commit:     851a8a7fd451db3dcd5d44d784083f0f66b24d57
Parent:     cb32da0416b823b7f4b65e7e85d6cba16ca4d1e1
Author:     Jesper Juhl <[EMAIL PROTECTED]>
AuthorDate: Wed Jul 18 00:49:08 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Jul 18 08:38:22 2007 -0700

    dm: fix memory leak in dm_create_persistent() when starting metadata update 
thread fails
    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 <[EMAIL PROTECTED]
    Acked-by: Alasdair G Kergon <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
 drivers/md/dm-exception-store.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/md/dm-exception-store.c b/drivers/md/dm-exception-store.c
index 3d65917..8fe81e1 100644
--- a/drivers/md/dm-exception-store.c
+++ b/drivers/md/dm-exception-store.c
@@ -623,6 +623,7 @@ int dm_create_persistent(struct exception_store *store)
        ps->metadata_wq = create_singlethread_workqueue("ksnaphd");
        if (!ps->metadata_wq) {
+               kfree(ps);
                DMERR("couldn't start header metadata update thread");
                return -ENOMEM;
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at

Reply via email to