diff options
author | Wenwen Wang <wenwen@cs.uga.edu> | 2019-08-18 19:18:34 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-29 08:28:55 +0200 |
commit | 2cff6c87a0dcb83b886b07e32e69f840e5b84cfd (patch) | |
tree | 15f4867491fb0b1a90ccfbd6ab3fff4b94a98bbd | |
parent | 795b0572729bc828710f8783feb432678da87ccb (diff) | |
download | linux-stable-2cff6c87a0dcb83b886b07e32e69f840e5b84cfd.tar.gz linux-stable-2cff6c87a0dcb83b886b07e32e69f840e5b84cfd.tar.bz2 linux-stable-2cff6c87a0dcb83b886b07e32e69f840e5b84cfd.zip |
dm raid: add missing cleanup in raid_ctr()
commit dc1a3e8e0cc6b2293b48c044710e63395aeb4fb4 upstream.
If rs_prepare_reshape() fails, no cleanup is executed, leading to
leak of the raid_set structure allocated at the beginning of
raid_ctr(). To fix this issue, go to the label 'bad' if the error
occurs.
Fixes: 11e4723206683 ("dm raid: stop keeping raid set frozen altogether")
Cc: stable@vger.kernel.org
Signed-off-by: Wenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/md/dm-raid.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c index c44925e4e481..b78a8a4d061c 100644 --- a/drivers/md/dm-raid.c +++ b/drivers/md/dm-raid.c @@ -3199,7 +3199,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv) */ r = rs_prepare_reshape(rs); if (r) - return r; + goto bad; /* Reshaping ain't recovery, so disable recovery */ rs_setup_recovery(rs, MaxSector); |