Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Imre Kaloz" <kaloz@kernel.org>
Cc: linux-rtc@vger.kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH 25/38] rtc: m48t35: support the SGI IP35 timekeeper's 1968 year base
Date: Sat, 03 Oct 2026 01:33:14 +0000	[thread overview]
Message-ID: <20261003013315.1439E1F00899@smtp.kernel.org> (raw)
In-Reply-To: <7c2b71a1627e49209a8c3311f4283eb92325852c.1790857966.git.kaloz@kernel.org>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] rtc: m48t35: null pointer dereference in m48t35_probe() via driver_override
--

commit 697b757d9c2a3da93baaf70e4fd5d745beae964e
Author: Imre Kaloz <kaloz@kernel.org>

rtc: m48t35: support the SGI IP35 timekeeper's 1968 year base

This commit updates the M48T35 RTC driver to support the 1968 year base for 
SGI IP35-family machines. It assigns a base epoch using the platform device ID
table and bounds the year to the appropriate century.

> diff --git a/drivers/rtc/rtc-m48t35.c b/drivers/rtc/rtc-m48t35.c
> index 92f19bf997b2f..69c313b4b6e84 100644
> --- a/drivers/rtc/rtc-m48t35.c
> +++ b/drivers/rtc/rtc-m48t35.c

[ ... ]

> @@ -164,6 +154,7 @@ static int m48t35_probe(struct platform_device *pdev)
>  				     pdev->name))
>  		return -EBUSY;
>  
> +	priv->epoch = platform_get_device_id(pdev)->driver_data;

[Severity: High]
Does this code handle devices bound via sysfs driver_override?

If the driver is manually bound to a device using the sysfs driver_override
interface, the platform bus platform_match() function returns success without
calling platform_match_id(). This leaves pdev->id_entry as null.

Since platform_get_device_id(pdev) returns pdev->id_entry, wouldn't
dereferencing its result directly cause a null pointer dereference regression?

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1790857966.git.kaloz@kernel.org?part=25

      reply	other threads:[~2026-10-03  1:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1790857966.git.kaloz@kernel.org>
2026-10-01 16:12 ` [PATCH 25/38] rtc: m48t35: support the SGI IP35 timekeeper's 1968 year base Imre Kaloz
2026-10-03  1:33   ` sashiko-bot [this message]

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=20261003013315.1439E1F00899@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=kaloz@kernel.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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