spi: fix double-free on spi_unregister_master
authorAtsushi Nemoto <anemo@mba.ocn.ne.jp>
Thu, 15 Nov 2007 00:59:22 +0000 (16:59 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 15 Nov 2007 02:45:39 +0000 (18:45 -0800)
commit350d0076c5763ca2b88ca05e3889bfa7c1905f21
tree94221d457f4f7424e9ff10789f9289181ecc5066
parentcbff2fbf55c21f50298b1aef1263b11bf510e35f
spi: fix double-free on spi_unregister_master

After 49dce689ad4ef0fd1f970ef762168e4bd46f69a3, device_for_each_child
iteration hits the master device itself.  Do not call spi_unregister_device()
for the master device.

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Acked-by: David Brownell <david-b@pacbell.net>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/spi/spi.c