]> git.karo-electronics.de Git - karo-tx-linux.git/commit
mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions()
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 25 Sep 2012 09:57:13 +0000 (15:27 +0530)
committerBen Hutchings <ben@decadent.org.uk>
Thu, 6 Dec 2012 11:20:21 +0000 (11:20 +0000)
commit016ede1a94fbd90c2a24a82599859f9e46e3c298
treecd4a9f46ecfba2897469d3c66d11618f78d875ae
parentd8c460f04c9ed2c0089b6e97223cd22653aaf8f0
mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions()

commit 5a6ea4af0907f995dc06df21a9c9ef764c7cd3bc upstream.

The pointer returned by kzalloc should be tested for NULL
to avoid potential NULL pointer dereference later. Incorrect
pointer was being tested for NULL. Bug introduced by commit fbcf62a3
(mtd: physmap_of: move parse_obsolete_partitions to become separate
parser).
This patch fixes this bug.

Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Artem Bityutskiy <artem.bityutskiy@intel.com>
Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/mtd/ofpart.c