[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdWVEsn7=Z69xMFb-HZxUbc4iDtUnY7mp1i_tn9k1X_JsA@mail.gmail.com>
Date: Mon, 16 Jun 2014 18:06:14 +0200
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Jürg Billeter <j@...ron.ch>
Cc: Mark Brown <broonie@...nel.org>,
linux-spi <linux-spi@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Magnus Damm <damm@...nsource.se>
Subject: Re: [PATCH] spi: sh-sci: fix use-after-free in sh_sci_spi_remove()
On Mon, Jun 16, 2014 at 4:39 PM, Jürg Billeter <j@...ron.ch> wrote:
> setbits() uses sp->membase.
>
> Signed-off-by: Jürg Billeter <j@...ron.ch>
Acked-by: Geert Uytterhoeven <geert@...ux-m68k.org>
> ---
> 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
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists