mmc_block: handle error from mmc_register_driver()
PATCH 1/1 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 <[email protected]>
Cc Pierre Ossman <[email protected]>
--- drivers/mmc/card/block.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/mmc/card/block.c +7 -2
@@ -615,14 +615,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; }
Quoted 6 lines · On Sat, 13 Sep 2008 19:02:07 +0900 Akinobu Mita <[email protected]> wrote:
Check error from
mmc_register_driver()and properly unwind block device registration.Signed-off-by Akinobu Mita <[email protected]>Cc Pierre Ossman <[email protected]>---
Looks good. Applied.
Signature · 9 lines
-- Pierre Ossman Linux kernel, MMC maintainer http://www.kernel.org rdesktop, core developer http://www.rdesktop.org WARNING: This correspondence is being monitored by the Swedish government. Make sure your server uses encryption for SMTP traffic and consider using PGP for end-to-end encryption.