From: Artem Bityutskiy Date: Mon, 18 Apr 2011 04:50:37 +0000 (+0300) Subject: mtd: mtd_blkdevs: fix error path in blktrans_open X-Git-Tag: v3.0-rc1~32^2~85 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94735ec4044a6d318b83ad3c5794e931ed168d10;p=pandora-kernel.git mtd: mtd_blkdevs: fix error path in blktrans_open The 'blktrans_open()' does not handle possible '__get_mtd_device()' failures because it does not check the error code. Moreover, the 'dev->tr->open()' failures are not handled correctly because in this case the function just goes ahead and gets the mtd device, then returns an error. But Instead, it should _not_ try to get the mtd device, then it should put back the module and the kref. This patch fixes the issue. Note, I only compile-tested it. This patch was inspired by a bug report about a similar issue in 2.6.34 kernels sent by Mike Turner to the MTD mailing list: http://lists.infradead.org/pipermail/linux-mtd/2011-April/034980.html Signed-off-by: Artem Bityutskiy Signed-off-by: David Woodhouse --- Reading git-diff-tree failed