]> www.infradead.org Git - users/dwmw2/linux.git/commit
dm raid: add missing cleanup in raid_ctr()
authorWenwen Wang <wenwen@cs.uga.edu>
Mon, 19 Aug 2019 00:18:34 +0000 (19:18 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 29 Aug 2019 06:30:25 +0000 (08:30 +0200)
commitf57bbd7c789468dda655d0b652c06c961eeb510b
tree500077a6a649543715d460feca6fe92e3bacf260
parente7b9e2afcc68ffb82462f607cf9d52e30e2217c3
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>
drivers/md/dm-raid.c