Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp501487rdh; Wed, 14 Feb 2024 03:30:03 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4YtBHaYTEZ+BWF7/PJxSDJrRvvJA3oWi2mM7EuLQeneo7P6448rie4k2JufXGVVuyc9YOXhkSQ17Ys7KCcZji5e8gZyWBP09Jp18m4g== X-Google-Smtp-Source: AGHT+IG3X+XltxQe5WIwXj21dSAhiyU49Wm0pQzMEmQc8OsbhYTYOk6xM63qSTOF0HVvYdzJ0jeC X-Received: by 2002:a05:622a:252:b0:42d:ac51:ba52 with SMTP id c18-20020a05622a025200b0042dac51ba52mr2644248qtx.16.1707910202850; Wed, 14 Feb 2024 03:30:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707910202; cv=pass; d=google.com; s=arc-20160816; b=D3JHNDcxFfhMGhD6E7UuEPue5H1BMZw4IG+BRs6XhRIZT/4djyR9JLkEdwqleIQdk7 OJbryFgj1JO1o/uuAqU55UnWV9f7bwGcPP4OFRxPISdnb7CUi3t4I02FIM6/+YPtYRQm +i8X28Qzj3uErMmiz+yIpLL9Tkh1ziuEeXMcdHTzpTCfG76l+xlFCrJbLboEwOw2YL2s Px/bMO2WWN7TJbdiwvGah/a+tOQU/xDZc64ZeNzTpYYHMgSNDFKxTq/RTBG8Qysa7rzu SYT/ECc56nR6Xkv9KxupZ4facNPxiFvFnal0VHcYRwJMMJiZ2nqEwaB1KJXgnxMmWnWG RAOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=8s6CHToFBHYnZYfXO7kp5Ap94jmYkYkIJg/kOerPzD8=; fh=4CZFg7dQF1yMWtRnfF7K7JYpFd0Yomw0Xo0EvtSs3AE=; b=ZD6VbFjsQjTnMfddx19MBa9JxlO7hB1D+reGfSUlRSEYt5yeedPBio0nmhDiPB7Nes SrEZFTahAtR6Kllo03hbH7BM73eQlhgIVS1FW38EdsGk73kyuqk536Q38t5V9ST9wqOz MY5oVLNeIzhYYqINjeXv1/Z0duTXqUHYaV9EEUt8m6q7AEUrp9Py8iL2T28monbJ+rOZ dfDCr1Peu+wFQyhV6G7qL/Cw6XnKyMM5a7VsrAHeWkOoepDKsWTmRfSpzIwXfcd7cqOX u6HswSSkOImMWMn/4BWF2nxhJsGEbTousiYS+6EVu6xGtgyOSpU1gZQuTEywnqI2ZhIN 46FQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lk5MkD+w; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-65126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de X-Forwarded-Encrypted: i=2; AJvYcCWMUWCNj9Fk+g2umdxPTAL36qqhZmP0LslL9tVV4dz9nlneJk06jI6yc1npZxBlexzCMetxgUUVLGBf0ORrasKTUGyXB+ism2I392McCw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 7-20020ac85647000000b0042c24902693si4846728qtt.741.2024.02.14.03.30.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 03:30:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lk5MkD+w; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-65126-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65126-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 97AA91C213E1 for ; Wed, 14 Feb 2024 11:30:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D27FF1AADF; Wed, 14 Feb 2024 11:29:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Lk5MkD+w"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="weoa5/wF" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94CF1199BA for ; Wed, 14 Feb 2024 11:29:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707910183; cv=none; b=QTWpzm+pZbKGrgDZHlvOWdQ/KYChbJFWlneKJb73+5tfww7S8UNfFSg/b/16xYKiONTljG7sCw68T2rB4uvo3GEOKdYxei1HCXmMHU+26EdAc5CTWC09Xr3D46XAAHdAMfu7dOx+aSRcexW7czq/T2Rnxagm+G7NhTio3ahJt2s= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707910183; c=relaxed/simple; bh=f8ggq14jVYuQQrAMubcEH8iyKz3Jg3aj+r85czftW7g=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=WmfaKqoBWpvE3sMbltKBiTx9yHgK+Uh/9mtwGFp6sw7xSJqEpRyjlGxvf2e+/XHdCAn+4XsyD1dqE3LdbpdPYp0dC74YSM1c0HwYEkY22gy1oHjklK31GkSQ2m46158NJKokvwwmuQl5RkGTZ1BjPA8nSoelsBNIPcPjVgB/IpA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Lk5MkD+w; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=weoa5/wF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1707910179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8s6CHToFBHYnZYfXO7kp5Ap94jmYkYkIJg/kOerPzD8=; b=Lk5MkD+wMhus0vMIdV/IQG0l3Qi8Qnq97uWx04fNdmYngnbVD+m+QRNxd7875uccAzy9b4 3FxttNGVb+Vqt9Zlmj+elYpkUi/VMiSazXZB1tg/lRYeQm+nHK/4e5fcpWhQBrFxY644l1 AmELuNJ6StMD4l4Nx65ofOm5Vwj3zPyRYPPNzXvWQXtD0fCCfsJ+VRjsNBQyH7+mkDlnLg +UjYFdWSbWr+g8OKR6n+bX+vPeilYV6amd1fnQFqVDvC73vHsTFb+UVz4dsWf5KneP7aXy gwMQqVhJTK7AlpsmrNx3OjH0nZjXAXfHbFfW5/g6icMdXLaGXiNbxUhyUbHwLA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1707910179; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=8s6CHToFBHYnZYfXO7kp5Ap94jmYkYkIJg/kOerPzD8=; b=weoa5/wF//9GIHPNbQ+v8nr+cMA2CCtYPaOMDPMvnMXZS91vz+Ue5M4yah/yObX34ACgmA ZHgd84BWYNRo0+Bg== To: Pranav Prasad , jstultz@google.com, sboyd@kernel.org Cc: linux-kernel@vger.kernel.org, krossmo@google.com, Pranav Prasad Subject: Re: [PATCH v3 1/2] alarmtimer: Add PM notifier to check early for imminent alarm In-Reply-To: <20240214092902.1908443-2-pranavpp@google.com> References: <20240214092902.1908443-1-pranavpp@google.com> <20240214092902.1908443-2-pranavpp@google.com> Date: Wed, 14 Feb 2024 12:29:38 +0100 Message-ID: <87mss3ffml.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain 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