mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] spi: sh-sci: fix use-after-free in sh_sci_spi_remove()
@ 2014-06-16 14:39 Jürg Billeter
  2014-06-16 16:06 ` Geert Uytterhoeven
  2014-06-17 14:47 ` Mark Brown
  0 siblings, 2 replies; 3+ messages in thread
From: Jürg Billeter @ 2014-06-16 14:39 UTC (permalink / raw)
  To: Mark Brown; +Cc: linux-spi, linux-kernel, Jürg Billeter

setbits() uses sp->membase.

Signed-off-by: Jürg Billeter <j@bitron.ch>
---
 drivers/spi/spi-sh-sci.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-sh-sci.c b/drivers/spi/spi-sh-sci.c
index 1f56ef6..b83dd73 100644
--- a/drivers/spi/spi-sh-sci.c
+++ b/drivers/spi/spi-sh-sci.c
@@ -175,9 +175,9 @@ static int sh_sci_spi_remove(struct platform_device *dev)
 {
 	struct sh_sci_spi *sp = platform_get_drvdata(dev);
 
-	iounmap(sp->membase);
-	setbits(sp, PIN_INIT, 0);
 	spi_bitbang_stop(&sp->bitbang);
+	setbits(sp, PIN_INIT, 0);
+	iounmap(sp->membase);
 	spi_master_put(sp->bitbang.master);
 	return 0;
 }
-- 
2.0.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2014-06-17 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-16 14:39 [PATCH] spi: sh-sci: fix use-after-free in sh_sci_spi_remove() Jürg Billeter
2014-06-16 16:06 ` Geert Uytterhoeven
2014-06-17 14:47 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®