1
0
Fork 0

spi: sh-sci: fix use-after-free in sh_sci_spi_remove()

setbits() uses sp->membase.

Signed-off-by: Jürg Billeter <j@bitron.ch>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
hifive-unleashed-5.1
Jürg Billeter 2014-06-16 16:39:29 +02:00 committed by Mark Brown
parent 7171511eae
commit 25f8a7cc58
1 changed files with 2 additions and 2 deletions

View File

@ -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;
}