]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd/docg3: dereferencing an ERR_PTR() in docg3_probe()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 28 Nov 2011 13:53:13 +0000 (16:53 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@intel.com>
Thu, 1 Dec 2011 08:02:25 +0000 (10:02 +0200)
commit194481f157d0686c08b3d5f5cb7104c6a40b4ac7
treece02d4751056598e879b176c20bf02e99c70980e
parent04e6d4cd2fe4bc83356e3eec14dd7fd632b74d66
mtd/docg3: dereferencing an ERR_PTR() in docg3_probe()

If doc_probe_device() returned an ERR_PTR, then we accidentally saved
that to docg3_floors[floor] = mtd; which gets derefenced in the error
handling when we call doc_release_device().

I've reworked the error handling to take care of that and hopefully
make it a little simpler.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@intel.com>
drivers/mtd/devices/docg3.c