mmc/card/block.c : mmc_blk_open readonly mount bug?

From: sasin
Date: Thu Sep 04 2008 - 06:16:49 EST


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.

"return -EROFS;"

should be replaced by

"
{
ret = -EROFS;
mmc_blk_put(md);
}
"


Best regards,
Sasi
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/