]> 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)
committerArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
Wed, 10 Oct 2012 14:35:44 +0000 (17:35 +0300)
commit03ba2bfe44c1e7bfcd628b08242370c3f0e3feb0
treeaa009a1f002a0e55ebe7972c2b2c37ea7ec78567
parentc525349b0cc69c5892a21d0dcc8693aef965af76
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