]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Dec 2012 19:37:58 +0000 (11:37 -0800)
commitc7722a17ff0221200ab0bba034759f175c886b4e
treed937831c975fa8b258dc7610380932ec4c7f69cc
parent4a6195797eb31a910eb13b891612c24f9643df60
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.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Cc: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Cc: Artem Bityutskiy <artem.bityutskiy@intel.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mtd/ofpart.c