Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 25f8a7cc authored by Jürg Billeter's avatar Jürg Billeter Committed by Mark Brown
Browse files

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



setbits() uses sp->membase.

Signed-off-by: default avatarJürg Billeter <j@bitron.ch>
Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 7171511e
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
}