md: tidy up error paths in md_alloc
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: NJiri Slaby <jirislaby@gmail.com> Signed-off-by: NNeilBrown <neilb@suse.de>
Showing
想要评论请 注册 或 登录