Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=55b42c5ae9c048de25233434afc7b71b01bee9e6
Commit:     55b42c5ae9c048de25233434afc7b71b01bee9e6
Parent:     027d50f92ea26fd065aeb141ebfcbbbe010825e3
Author:     Dmitry Monakhov <[EMAIL PROTECTED]>
AuthorDate: Fri Oct 19 22:38:37 2007 +0100
Committer:  Alasdair G Kergon <[EMAIL PROTECTED]>
CommitDate: Sat Oct 20 02:00:59 2007 +0100

    dm crypt: drop device ref in ctr error path
    
    Add a missing 'dm_put_device' in an error path in crypt target constructor.
    
    Signed-off-by: Dmitry Monakhov <[EMAIL PROTECTED]>
    Signed-off-by: Milan Broz <[EMAIL PROTECTED]>
    Signed-off-by: Alasdair G Kergon <[EMAIL PROTECTED]>
---
 drivers/md/dm-crypt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 64fee90..ecd9ef0 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -861,7 +861,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int 
argc, char **argv)
                cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL);
                if (!cc->iv_mode) {
                        ti->error = "Error kmallocing iv_mode string";
-                       goto bad5;
+                       goto bad_iv_mode;
                }
                strcpy(cc->iv_mode, ivmode);
        } else
@@ -870,6 +870,8 @@ static int crypt_ctr(struct dm_target *ti, unsigned int 
argc, char **argv)
        ti->private = cc;
        return 0;
 
+bad_iv_mode:
+       dm_put_device(ti, cc->dev);
 bad5:
        bioset_free(cc->bs);
 bad_bs:
-
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  http://vger.kernel.org/majordomo-info.html

Reply via email to