]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: physmap: fix NULL pointer dereference in error path
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Tue, 10 Mar 2009 19:55:55 +0000 (12:55 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 10 Mar 2009 22:55:11 +0000 (15:55 -0700)
commit433c56b8f307b851a034572e0cba3907459859f3
tree090e82a516fe8db760a1b7514ed072bb458c1e2f
parent4e6e4624fb3f4a9f7a8588f7fcc08aed1de4fb44
mtd: physmap: fix NULL pointer dereference in error path

commit 36f3b5e390200a4c4e6fbee7d368727d6abcbe2f ("[MTD] [MAPS] physmap:
fix wrong free and del_mtd_{partition,device}") introduces a NULL pointer
dereference in physmap_flash_remove when called from the error path in
physmap_flash_probe (if map_probe failed).

Call del_mtd_{partition,device} only if info->cmtd was not NULL.

Reported-by: pHilipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/mtd/maps/physmap.c