mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-12 13:55:32 +00:00
mmc_block: handle error from mmc_register_driver()
Check error from mmc_register_driver() and properly unwind block device registration. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
This commit is contained in:
parent
da45b66ec8
commit
9d4e98e960
1 changed files with 7 additions and 2 deletions
|
@ -613,14 +613,19 @@ static struct mmc_driver mmc_driver = {
|
|||
|
||||
static int __init mmc_blk_init(void)
|
||||
{
|
||||
int res = -ENOMEM;
|
||||
int res;
|
||||
|
||||
res = register_blkdev(MMC_BLOCK_MAJOR, "mmc");
|
||||
if (res)
|
||||
goto out;
|
||||
|
||||
return mmc_register_driver(&mmc_driver);
|
||||
res = mmc_register_driver(&mmc_driver);
|
||||
if (res)
|
||||
goto out2;
|
||||
|
||||
return 0;
|
||||
out2:
|
||||
unregister_blkdev(MMC_BLOCK_MAJOR, "mmc");
|
||||
out:
|
||||
return res;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue