Skip to content

Commit

Permalink
spi: sh-sci: fix use-after-free in sh_sci_spi_remove()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jürg Billeter authored and Mark Brown committed Jun 17, 2014
1 parent 7171511 commit 25f8a7c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/spi/spi-sh-sci.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 25f8a7c

Please sign in to comment.