md: tidy up error paths in md_alloc
authorNeilBrown <neilb@suse.de>
Wed, 1 Jul 2009 02:27:21 +0000 (12:27 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 1 Jul 2009 02:27:21 +0000 (12:27 +1000)
As the recent bug in md_alloc showed, having a single exit path for
unlocking and putting is a good idea.  So restructure md_alloc to have
a single mutex_unlock and mddev_put, and use gotos where necessary.

Found-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: NeilBrown <neilb@suse.de>

No differences found