dm raid: add missing cleanup in raid_ctr()

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: 11e4723206 ("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>
This commit is contained in:
Wenwen Wang 2019-08-18 19:18:34 -05:00 committed by Mike Snitzer
parent e0702d90b7
commit dc1a3e8e0c
1 changed files with 1 additions and 1 deletions

View File

@ -3194,7 +3194,7 @@ static int raid_ctr(struct dm_target *ti, unsigned int argc, char **argv)
*/ */
r = rs_prepare_reshape(rs); r = rs_prepare_reshape(rs);
if (r) if (r)
return r; goto bad;
/* Reshaping ain't recovery, so disable recovery */ /* Reshaping ain't recovery, so disable recovery */
rs_setup_recovery(rs, MaxSector); rs_setup_recovery(rs, MaxSector);