[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMuHMdXH8qw9SMD4=SDNUeZUTm2ar1hO7Ev23r9ypFziZstKUw@mail.gmail.com>
Date: Mon, 28 Dec 2020 08:48:12 +0100
From: Geert Uytterhoeven <geert@...ux-m68k.org>
To: Defang Bo <bodefang@....com>
Cc: Greg Ungerer <gerg@...ux-m68k.org>,
linux-m68k <linux-m68k@...ts.linux-m68k.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] m68k: let clk_enable() return immediately if clk is NULL
Hi Defang,
On Mon, Dec 28, 2020 at 3:08 AM Defang Bo <bodefang@....com> wrote:
> Similar to commit<742859adc721>("m68k: let clk_disable() return immediately if clk is NULL").
> there should be a check for clk to prevent NULL pointer dereference.
>
> Signed-off-by: Defang Bo <bodefang@....com>
Thanks for your patch!
> --- a/arch/m68k/coldfire/clk.c
> +++ b/arch/m68k/coldfire/clk.c
> @@ -90,6 +90,9 @@ EXPORT_SYMBOL(clk_get);
> int clk_enable(struct clk *clk)
> {
> unsigned long flags;
Please keep the blank line between variable declarations and
statements (no complaint from scripts/checkpatch.pl? See
Documentation/process/submitting-patches.rst
).
> + if (!clk)
> + return -EINVAL;
> +
> spin_lock_irqsave(&clk_lock, flags);
> if ((clk->enabled++ == 0) && clk->clk_ops)
> clk->clk_ops->enable(clk);
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
Powered by blists - more mailing lists