The patch titled spi: fix double-free on spi_unregister_master has been added to the -mm tree. Its filename is spi-fix-double-free-on-spi_unregister_master.patch *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: spi: fix double-free on spi_unregister_master From: Atsushi Nemoto <anemo@xxxxxxxxxxxxx> 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@xxxxxxxxxxxxx> Cc: David Brownell <david-b@xxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/spi/spi.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff -puN drivers/spi/spi.c~spi-fix-double-free-on-spi_unregister_master drivers/spi/spi.c --- a/drivers/spi/spi.c~spi-fix-double-free-on-spi_unregister_master +++ a/drivers/spi/spi.c @@ -457,10 +457,11 @@ done: EXPORT_SYMBOL_GPL(spi_register_master); -static int __unregister(struct device *dev, void *unused) +static int __unregister(struct device *dev, void *master_dev) { /* note: before about 2.6.14-rc1 this would corrupt memory: */ - spi_unregister_device(to_spi_device(dev)); + if (dev != master_dev) + spi_unregister_device(to_spi_device(dev)); return 0; } @@ -478,7 +479,8 @@ void spi_unregister_master(struct spi_ma { int dummy; - dummy = device_for_each_child(master->dev.parent, NULL, __unregister); + dummy = device_for_each_child(master->dev.parent, &master->dev, + __unregister); device_unregister(&master->dev); } EXPORT_SYMBOL_GPL(spi_unregister_master); _ Patches currently in -mm which might be from anemo@xxxxxxxxxxxxx are origin.patch rtcs-handle-nvram-better.patch spi-fix-double-free-on-spi_unregister_master.patch spi-fix-error-paths-on-txx9spi_probe.patch clocksource-make-clocksource_mask-bullet-proof.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html