* [PATCH] mmc_block: handle error from mmc_register_driver()
@ 2008-09-13 10:02 Akinobu Mita
2008-09-20 11:03 ` Pierre Ossman
0 siblings, 1 reply; 2+ messages in thread
From: Akinobu Mita @ 2008-09-13 10:02 UTC (permalink / raw)
To: linux-kernel; +Cc: Pierre Ossman
Check error from mmc_register_driver() and properly unwind
block device registration.
Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
---
drivers/mmc/card/block.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
Index: 2.6-git/drivers/mmc/card/block.c
===================================================================
--- 2.6-git.orig/drivers/mmc/card/block.c
+++ 2.6-git/drivers/mmc/card/block.c
@@ -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;
}
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mmc_block: handle error from mmc_register_driver()
2008-09-13 10:02 [PATCH] mmc_block: handle error from mmc_register_driver() Akinobu Mita
@ 2008-09-20 11:03 ` Pierre Ossman
0 siblings, 0 replies; 2+ messages in thread
From: Pierre Ossman @ 2008-09-20 11:03 UTC (permalink / raw)
To: Akinobu Mita; +Cc: linux-kernel
On Sat, 13 Sep 2008 19:02:07 +0900
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> Check error from mmc_register_driver() and properly unwind
> block device registration.
>
> Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
> Cc: Pierre Ossman <drzeus-mmc@drzeus.cx>
> ---
Looks good. Applied.
--
-- 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.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2008-09-20 11:03 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-09-13 10:02 [PATCH] mmc_block: handle error from mmc_register_driver() Akinobu Mita
2008-09-20 11:03 ` Pierre Ossman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox