From: H Hartley Sweeten Date: Mon, 19 Oct 2009 17:31:46 +0000 (-0400) Subject: mtd: Fix kernel NULL pointer dereference in physmap.c X-Git-Tag: v2.6.33-rc1~66^2~56 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4b56ffcacee937a85bf39e14872dd141e23ee85f;p=pandora-kernel.git mtd: Fix kernel NULL pointer dereference in physmap.c During the probe for physmap platform flash devices there are a number error exit conditions that all do a goto err_out which then calls physmap_flash_remove(). In that function one of the cleanup steps is: #ifdef CONFIG_MTD_CONCAT if (info->cmtd != info->mtd[0]) mtd_concat_destroy(info->cmtd); #endif This test will succeed since info->cmtd == NULL and info->mtd[0] is valid. Fix this by exiting the remove function when info->cmtd == NULL. Also, cleanup the #ifdef CONFIG_MTD_PARTITIONS stuff by using mtd_has_partitions(). Signed-off-by: H Hartley Sweeten Signed-off-by: David Woodhouse --- Reading git-diff-tree failed