diff options
author | Dmitry Monakhov <dmonakhov@openvz.org> | 2007-10-19 17:38:37 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2007-10-19 21:00:59 -0400 |
commit | 55b42c5ae9c048de25233434afc7b71b01bee9e6 (patch) | |
tree | 872a9e8cd132f89ed29ba242e53f5877702cbb17 | |
parent | 027d50f92ea26fd065aeb141ebfcbbbe010825e3 (diff) |
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 <dmonakhov@openvz.org>
Signed-off-by: Milan Broz <mbroz@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
-rw-r--r-- | 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 64fee90bb68b..ecd9ef0418cd 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) | |||
861 | cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL); | 861 | cc->iv_mode = kmalloc(strlen(ivmode) + 1, GFP_KERNEL); |
862 | if (!cc->iv_mode) { | 862 | if (!cc->iv_mode) { |
863 | ti->error = "Error kmallocing iv_mode string"; | 863 | ti->error = "Error kmallocing iv_mode string"; |
864 | goto bad5; | 864 | goto bad_iv_mode; |
865 | } | 865 | } |
866 | strcpy(cc->iv_mode, ivmode); | 866 | strcpy(cc->iv_mode, ivmode); |
867 | } else | 867 | } else |
@@ -870,6 +870,8 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) | |||
870 | ti->private = cc; | 870 | ti->private = cc; |
871 | return 0; | 871 | return 0; |
872 | 872 | ||
873 | bad_iv_mode: | ||
874 | dm_put_device(ti, cc->dev); | ||
873 | bad5: | 875 | bad5: |
874 | bioset_free(cc->bs); | 876 | bioset_free(cc->bs); |
875 | bad_bs: | 877 | bad_bs: |