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)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Thu, 15 Nov 2012 13:37:46 +0000 (15:37 +0200)
commitecbcbc7b75bb1b7596fca2d588d2f7539dc4e581
tree09bd4bbff8702d975a3e4d39a05fd870198a5eb5
parent0aa87b7563f138149429f35727b975ec25a494a6
mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions()

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: stable@vger.kernel.org [3.2+]
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
drivers/mtd/ofpart.c