mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Imre Kaloz" <kaloz@kernel.org>
To: "Lee Jones" <lee@kernel.org>, "Joshua Kinard" <linux@kumba.dev>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Matthias Fuchs" <matthias.fuchs@esd-electronics.com>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	linux-rtc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: stable@vger.kernel.org
Subject: Re: [PATCH 08/10] rtc: ds1685: check driver data for NULL in ds1685_rtc_poweroff()
Date: Sun, 29 Nov 2026 17:08:44 +0100	[thread overview]
Message-ID: <fe5e766a-105d-40e9-b612-4a804f6e03ff@app.fastmail.com> (raw)
In-Reply-To: <20261123200012.502284-9-lee@kernel.org>

Hi Lee,

On Mon, Nov 23, 2026, at 20:59, Lee Jones wrote:
> ip32_poweroff() invokes ds1685_rtc_poweroff() with the static
> ip32_rtc_device platform device.  If ds1685_rtc_probe() previously
> failed or the device was unbound, platform_get_drvdata() returns NULL
> even though pdev is non-NULL, causing a NULL pointer dereference at
> rtc->irq_num instead of entering the intended fallback spin loop.
>
> Verify that platform_get_drvdata() is non-NULL alongside pdev before
> dereferencing rtc.
>
> Fixes: aaaf5fbf56f1 ("rtc: add driver for DS1685 family of real time clocks")
> Closes: https://sashiko.dev/#/bug/linux-0a1838c9-65d2-4d1c-bc21-35a6a2582144
> Cc: stable@vger.kernel.org
> Signed-off-by: Lee Jones <lee@kernel.org>

Tested on an SGI O2 (RM5200). With rtc-ds1685 unbound, poweroff -f
without this patch faults in ds1685_rtc_poweroff() on address 0x1c;
with it, the "spinning forever" message is printed instead. With the
driver bound, power-off works as before.

Tested-by: Imre Kaloz <kaloz@kernel.org>


Thanks,
Imre

  reply	other threads:[~2026-11-29 16:09 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-23 19:59 [PATCH 00/10] rtc: assorted bug fixes across RTC drivers Lee Jones
2026-11-23 19:59 ` [PATCH 01/10] rtc: rx8025: pass parent I2C device in clock_adjust_ppb sysfs callbacks Lee Jones
2026-11-23 19:59 ` [PATCH 02/10] rtc: mt6397: handle non-DT platform device matching in probe Lee Jones
2026-11-23 19:59 ` [PATCH 03/10] rtc: ma35d1: allocate RTC device before requesting interrupt Lee Jones
2026-11-23 19:59 ` [PATCH 04/10] rtc: mpc5121: get interrupts via platform_get_irq() Lee Jones
2026-11-23 19:59 ` [PATCH 05/10] rtc: m41t80: use devm helpers for square-wave clock registration Lee Jones
2026-11-23 19:59 ` [PATCH 06/10] rtc: nct3018y: fix clock provider use-after-free and leak on unbind Lee Jones
2026-11-23 19:59 ` [PATCH 07/10] rtc: stmp3xxx: unregister child watchdog platform device " Lee Jones
2026-11-23 19:59 ` [PATCH 08/10] rtc: ds1685: check driver data for NULL in ds1685_rtc_poweroff() Lee Jones
2026-11-29 16:08   ` Imre Kaloz [this message]
2026-11-23 19:59 ` [PATCH 09/10] rtc: omap: prevent NULL and dangling pointer dereferences in power-off path Lee Jones
2026-11-24  7:59   ` Johan Hovold
2026-11-23 19:59 ` [PATCH 10/10] rtc: bq32k: use u8 register buffer in trickle_charge_bypass sysfs Lee Jones

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=fe5e766a-105d-40e9-b612-4a804f6e03ff@app.fastmail.com \
    --to=kaloz@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=lee@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=linux@kumba.dev \
    --cc=matthias.fuchs@esd-electronics.com \
    --cc=stable@vger.kernel.org \
    /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®