All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	Stephen Boyd <sboyd@kernel.org>
Cc: Russell King <linux@armlinux.org.uk>,
	Michael Turquette <mturquette@baylibre.com>,
	Alexandru Ardelean <aardelean@deviqon.com>,
	kernel@pengutronix.de,
	Jonathan Cameron <Jonathan.Cameron@huawei.com>,
	linux-clk@vger.kernel.org, Jonathan Cameron <jic23@kernel.org>,
	Stephen Rothwell <sfr@canb.auug.org.au>
Subject: Re: [PATCH] clk: Fix pointer casting to prevent oops in devm_clk_release()
Date: Tue, 21 Jun 2022 11:52:13 +0200	[thread overview]
Message-ID: <20220621095213.m3bbsys34cga34tt@pengutronix.de> (raw)
In-Reply-To: <5ebb4585-90fa-02b5-a49c-dc81fce7285a@samsung.com>

[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]

Hello,

On Tue, Jun 21, 2022 at 08:25:23AM +0200, Marek Szyprowski wrote:
> On 20.06.2022 19:18, Uwe Kleine-König wrote:
> > The release function is called with a pointer to the memory returned by
> > devres_alloc(). I was confused about that by the code before the
> > generalization that used a struct clk **ptr.
> >
> > Reported-by: Marek Szyprowski <m.szyprowski@samsung.com>
> > Fixes: abae8e57e49a ("clk: generalize devm_clk_get() a bit")
> > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>

Thanks for your confirmation here.

> > ---
> > On Mon, Jun 20, 2022 at 05:26:12PM +0200, Marek Szyprowski wrote:
> >>> -   clk_put(*(struct clk **)res);
> >>> +   struct devm_clk_state *state = *(struct devm_clk_state **)res;
> >> This should be:
> >>
> >> struct devm_clk_state *state = res;
> >>
> >> otherwise it nukes badly during cleanup:
> >> [...]
> > How embarrassing. I understood how I confused that, but I wonder how
> > that didn't pop up earlier.
> >
> > FTR: I didn't test that now, but assume you did. My focus now was to get
> > out an applicable patch fast.

I fear that this issue will break some more tests, so I think it would
be good to get this fix quick into next.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2022-06-21  9:52 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-20  7:57 [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König
2022-05-20  7:57 ` Uwe Kleine-König
2022-05-20  7:57 ` [PATCH v9 1/4] clk: Improve documentation for devm_clk_get() and its optional variant Uwe Kleine-König
2022-06-07 11:46   ` Russell King (Oracle)
2022-06-16  2:35   ` Stephen Boyd
2022-05-20  7:57 ` [PATCH v9 2/4] clk: generalize devm_clk_get() a bit Uwe Kleine-König
2022-06-16  2:35   ` Stephen Boyd
     [not found]   ` <CGME20220620152612eucas1p2bd95bcec491a02c486d0a5f6b97864cd@eucas1p2.samsung.com>
2022-06-20 15:26     ` Marek Szyprowski
2022-06-20 17:18       ` [PATCH] clk: Fix pointer casting to prevent oops in devm_clk_release() Uwe Kleine-König
2022-06-21  6:25         ` Marek Szyprowski
2022-06-21  9:52           ` Uwe Kleine-König [this message]
2022-06-22 17:22         ` Uwe Kleine-König
2022-06-22 23:11         ` Stephen Boyd
2022-05-20  7:57 ` [PATCH v9 3/4] clk: Provide new devm_clk helpers for prepared and enabled clocks Uwe Kleine-König
2022-06-16  2:37   ` Stephen Boyd
2022-05-20  7:57 ` [PATCH v9 4/4] clk: meson: axg-audio: Don't duplicate devm_clk_get_enabled() Uwe Kleine-König
2022-05-20  7:57   ` Uwe Kleine-König
2022-06-16  2:37   ` Stephen Boyd
2022-06-16  2:37     ` Stephen Boyd
2022-06-07 11:08 ` [PATCH v9 0/4] clk: provide new devm helpers for prepared and enabled clocks Uwe Kleine-König
2022-06-07 11:08   ` Uwe Kleine-König
2022-06-07 11:42   ` Russell King (Oracle)
2022-06-07 11:42     ` Russell King (Oracle)

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=20220621095213.m3bbsys34cga34tt@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=Jonathan.Cameron@huawei.com \
    --cc=aardelean@deviqon.com \
    --cc=jic23@kernel.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=m.szyprowski@samsung.com \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=sfr@canb.auug.org.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.