[PATCH] mtd: mtd_blkdevs: fix error path in blktrans_open

Artem Bityutskiy dedekind1 at gmail.com
Mon Apr 18 01:02:31 EDT 2011


On Mon, 2011-04-18 at 08:04 +0300, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
> 
> 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 but returns an error. Instead, it should
> _not_ try to get the mtd device, then it should put back the module and kref.
> 
> This patch fixes the issue. Note, I only compile-test it but did not test.
> This patch was inspired bug report about a similar issue in 2.6.34 kernels
> sent by Mike Turner <admin at islandsoftware.co.uk> to the MTD mailing list:
> 
> http://lists.infradead.org/pipermail/linux-mtd/2011-April/034980.html
> 
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>

Fixed typos in the commit message:

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 <admin at islandsoftware.co.uk> to the MTD mailing list:

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list