Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 55b42c5a authored by Dmitry Monakhov's avatar Dmitry Monakhov Committed by Alasdair G Kergon
Browse files

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: default avatarDmitry Monakhov <dmonakhov@openvz.org>
Signed-off-by: default avatarMilan Broz <mbroz@redhat.com>
Signed-off-by: default avatarAlasdair G Kergon <agk@redhat.com>
parent 027d50f9
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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: