]> git.karo-electronics.de Git - mv-sheeva.git/commit
spi/pxa2xx pci: fix the release - remove race
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>
Wed, 2 Feb 2011 19:01:21 +0000 (00:31 +0530)
committerGrant Likely <grant.likely@secretlab.ca>
Tue, 15 Feb 2011 20:25:36 +0000 (13:25 -0700)
commit0f3e1d27a7e3f98d996d707d649128e229b65deb
tree0d5aacf251ae6ee733dcce5b2310e2d1128e7194
parentc170093d31bd4e3bc51881cc0f123beeca7872c9
spi/pxa2xx pci: fix the release - remove race

Right now the platform device and its platform data is included in one big
struct which requires its custom ->release function. The problem with the
release function within the driver is that it might be called after the
driver was removed because someone was holding a reference to it and it
was not called right after platform_device_unregister(). So we also free
the platform device memory to which one might hold a reference.

This patch uses the normal pdev functions so this kind of race does not
occur.

Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
drivers/spi/pxa2xx_spi_pci.c