public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Pranav Prasad <pranavpp@google.com>,
	jstultz@google.com, sboyd@kernel.org
Cc: linux-kernel@vger.kernel.org, krossmo@google.com,
	Pranav Prasad <pranavpp@google.com>
Subject: Re: [PATCH v3 1/2] alarmtimer: Add PM notifier to check early for imminent alarm
Date: Wed, 14 Feb 2024 12:29:38 +0100	[thread overview]
Message-ID: <87mss3ffml.ffs@tglx> (raw)
In-Reply-To: <20240214092902.1908443-2-pranavpp@google.com>

On Wed, Feb 14 2024 at 09:29, Pranav Prasad wrote:
> +static int alarmtimer_pm_callback(struct notifier_block *nb,
> +				  unsigned long mode, void *_unused)
> +{
> +	struct rtc_device *rtc;
> +	ktime_t min, expires;
> +	int type;
> +
> +	switch (mode) {
> +	case PM_SUSPEND_PREPARE:
> +		rtc = alarmtimer_get_rtcdev();
> +		/* If we have no rtcdev, just return */
> +		if (!rtc)
> +			return NOTIFY_DONE;
> +
> +		/* Find the soonest timer to expire */
> +		if (!alarmtimer_get_soonest(&min, &expires, &type))
> +			return NOTIFY_DONE;

Brilliant. Instead of a NULL pointer dereference you decided to add
undefined behaviour this time.

As it survived your "testing" it is obviously correct, right?

I'm tired of your approach to throw stuff at the wall in a hurry and see
what sticks.

Stop this frenzy. Sit down, take your time and do proper engineering
before coming back with this to me.

Thanks,

        tglx


  reply	other threads:[~2024-02-14 11:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-14  9:29 [PATCH v3 0/2] alarmtimer: Rework the suspend flow in alarmtimer Pranav Prasad
2024-02-14  9:29 ` [PATCH v3 1/2] alarmtimer: Add PM notifier to check early for imminent alarm Pranav Prasad
2024-02-14 11:29   ` Thomas Gleixner [this message]
2024-02-14  9:29 ` [PATCH v3 2/2] alarmtimer: Create sysfs to make alarm check window configurable Pranav Prasad

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=87mss3ffml.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=jstultz@google.com \
    --cc=krossmo@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pranavpp@google.com \
    --cc=sboyd@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