mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
To: tglx@linutronix.de, peterz@infradead.org
Cc: linux-kernel@vger.kernel.org,
	Kaushlendra Kumar <kaushlendra.kumar@intel.com>
Subject: [PATCH] smpboot: Add NULL check before kthread_unpark()
Date: Mon, 24 Nov 2025 10:41:44 +0530	[thread overview]
Message-ID: <20251124051144.1427596-1-kaushlendra.kumar@intel.com> (raw)

Add NULL check for tsk before calling kthread_unpark() in
smpboot_unpark_thread() to prevent potential null pointer
dereference.

Signed-off-by: Kaushlendra Kumar <kaushlendra.kumar@intel.com>
---
 kernel/smpboot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 4503b60ce9bd..a37d25b23f58 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -225,7 +225,7 @@ static void smpboot_unpark_thread(struct smp_hotplug_thread *ht, unsigned int cp
 {
 	struct task_struct *tsk = *per_cpu_ptr(ht->store, cpu);
 
-	if (!ht->selfparking)
+	if (tsk && !ht->selfparking)
 		kthread_unpark(tsk);
 }
 
-- 
2.34.1


             reply	other threads:[~2025-11-24  5:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-24  5:11 Kaushlendra Kumar [this message]
2025-12-10  6:50 ` Thomas Gleixner
2025-12-10  8:21   ` Kumar, Kaushlendra
2025-12-12  1:10     ` Thomas Gleixner

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=20251124051144.1427596-1-kaushlendra.kumar@intel.com \
    --to=kaushlendra.kumar@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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®