]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drivers/mmc/card/block.c: fix refcount leak in mmc_block_open()
authorAndrew Morton <akpm@linux-foundation.org>
Sat, 6 Sep 2008 01:10:03 +0000 (01:10 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 9 Oct 2008 02:44:40 +0000 (19:44 -0700)
commit24ac281c6c6ae8d1fe9752cb5647e6d140134a6f
tree02a38f3b85c87d0dacc4144d22e2ae06965fea6a
parentc73c1f8872fdb4aad48e791667ec3d0c180802ce
drivers/mmc/card/block.c: fix refcount leak in mmc_block_open()

commit 70bb08962ea9bd50797ae9f16b2493f5f7c65053 upstream

mmc_block_open() increments md->usage although it returns with -EROFS when
default mounting a MMC/SD card with write protect switch on.  This
reference counting bug prevents /dev/mmcblkX from being released on card
removal, and situation worsen with reinsertion until the minor number
range runs out.

Reported-by: <sasin@solomon-systech.com>
Acked-by: Pierre Ossman <drzeus-list@drzeus.cx>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/mmc/card/block.c