mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: Wan Jiabing <wanjiabing@vivo.com>,
	Hartley Sweeten <hsweeten@visionengravers.com>,
	Russell King <linux@armlinux.org.uk>,
	Nikita Shubin <nikita.shubin@maquefel.me>,
	Arnd Bergmann <arnd@arndb.de>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH] ep93xx: clock: Fix UAF in mach-ep93xx/clock.c
Date: Wed, 27 Apr 2022 06:19:50 +0200	[thread overview]
Message-ID: <a752f2d7d45d7f57b14cf45a01e583f9d8da0754.camel@gmail.com> (raw)
In-Reply-To: <20220427022111.772457-1-wanjiabing@vivo.com>

Thank you, Wan!

On Wed, 2022-04-27 at 10:21 +0800, Wan Jiabing wrote:
> Fix following coccicheck errors:
> ./arch/arm/mach-ep93xx/clock.c:351:9-12: ERROR: reference preceded by free on line 349
> ./arch/arm/mach-ep93xx/clock.c:458:9-12: ERROR: reference preceded by free on line 456
> 
> Fix two more potential UAF errors.
> 
> Link: https://lore.kernel.org/all/20220418121212.634259061@linuxfoundation.org/
> Fixes: 9645ccc7bd7a ("ep93xx: clock: convert in-place to COMMON_CLK")
> Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>

Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
>  arch/arm/mach-ep93xx/clock.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-ep93xx/clock.c
> index 4fa6ea5461b7..35f3734e512c 100644
> --- a/arch/arm/mach-ep93xx/clock.c
> +++ b/arch/arm/mach-ep93xx/clock.c
> @@ -345,8 +345,10 @@ static struct clk_hw *clk_hw_register_ddiv(const char *name,
>         psc->hw.init = &init;
>  
>         clk = clk_register(NULL, &psc->hw);
> -       if (IS_ERR(clk))
> +       if (IS_ERR(clk)) {
>                 kfree(psc);
> +               return ERR_CAST(clk);
> +       }
>  
>         return &psc->hw;
>  }
> @@ -452,8 +454,10 @@ static struct clk_hw *clk_hw_register_div(const char *name,
>         psc->hw.init = &init;
>  
>         clk = clk_register(NULL, &psc->hw);
> -       if (IS_ERR(clk))
> +       if (IS_ERR(clk)) {
>                 kfree(psc);
> +               return ERR_CAST(clk);
> +       }
>  
>         return &psc->hw;
>  }

-- 
Alexander Sverdlin.


  reply	other threads:[~2022-04-27  4:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-27  2:21 Wan Jiabing
2022-04-27  4:19 ` Alexander Sverdlin [this message]
2022-04-27  4:54 ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a752f2d7d45d7f57b14cf45a01e583f9d8da0754.camel@gmail.com \
    --to=alexander.sverdlin@gmail.com \
    --cc=arnd@arndb.de \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=nikita.shubin@maquefel.me \
    --cc=stable@vger.kernel.org \
    --cc=wanjiabing@vivo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®