From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: kernel/kthread.c:476 __kthread_create_on_node() warn: '&create->list' not removed from list
Date: Thu, 21 Nov 2024 13:39:04 +0800 [thread overview]
Message-ID: <202411211332.mOnyrG5e-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Adrian Hunter <adrian.hunter@intel.com>
CC: Thomas Gleixner <tglx@linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 43fb83c17ba2d63dfb798f0be7453ed55ca3f9c2
commit: 5284984a4fbacb0883bfebe905902cdda2891a07 bug: Fix no-return-statement warning with !CONFIG_BUG
date: 7 months ago
:::::: branch date: 6 hours ago
:::::: commit date: 7 months ago
config: hexagon-randconfig-r071-20241119 (https://download.01.org/0day-ci/archive/20241121/202411211332.mOnyrG5e-lkp@intel.com/config)
compiler: clang version 20.0.0git (https://github.com/llvm/llvm-project 592c0fe55f6d9a811028b5f3507be91458ab2713)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202411211332.mOnyrG5e-lkp@intel.com/
smatch warnings:
kernel/kthread.c:476 __kthread_create_on_node() warn: '&create->list' not removed from list
drivers/video/fbdev/sh_mobile_lcdcfb.c:2649 sh_mobile_lcdc_probe() warn: 'irq' from request_irq() not released on lines: 2649.
vim +476 kernel/kthread.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 426
c0b942a76361e0 Nicolas Iooss 2016-12-12 427 static __printf(4, 0)
c0b942a76361e0 Nicolas Iooss 2016-12-12 428 struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data),
2a1d446019f9a5 Thomas Gleixner 2012-07-16 429 void *data, int node,
^1da177e4c3f41 Linus Torvalds 2005-04-16 430 const char namefmt[],
255451e45345bc Petr Mladek 2016-10-11 431 va_list args)
^1da177e4c3f41 Linus Torvalds 2005-04-16 432 {
786235eeba0e1e Tetsuo Handa 2013-11-12 433 DECLARE_COMPLETION_ONSTACK(done);
786235eeba0e1e Tetsuo Handa 2013-11-12 434 struct task_struct *task;
786235eeba0e1e Tetsuo Handa 2013-11-12 435 struct kthread_create_info *create = kmalloc(sizeof(*create),
786235eeba0e1e Tetsuo Handa 2013-11-12 436 GFP_KERNEL);
786235eeba0e1e Tetsuo Handa 2013-11-12 437
786235eeba0e1e Tetsuo Handa 2013-11-12 438 if (!create)
786235eeba0e1e Tetsuo Handa 2013-11-12 439 return ERR_PTR(-ENOMEM);
786235eeba0e1e Tetsuo Handa 2013-11-12 440 create->threadfn = threadfn;
786235eeba0e1e Tetsuo Handa 2013-11-12 441 create->data = data;
786235eeba0e1e Tetsuo Handa 2013-11-12 442 create->node = node;
786235eeba0e1e Tetsuo Handa 2013-11-12 443 create->done = &done;
73e0c116594d99 Mike Christie 2023-03-10 444 create->full_name = kvasprintf(GFP_KERNEL, namefmt, args);
73e0c116594d99 Mike Christie 2023-03-10 445 if (!create->full_name) {
73e0c116594d99 Mike Christie 2023-03-10 446 task = ERR_PTR(-ENOMEM);
73e0c116594d99 Mike Christie 2023-03-10 447 goto free_create;
73e0c116594d99 Mike Christie 2023-03-10 448 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 449
73c279927f8956 Eric W. Biederman 2007-05-09 450 spin_lock(&kthread_create_lock);
786235eeba0e1e Tetsuo Handa 2013-11-12 451 list_add_tail(&create->list, &kthread_create_list);
73c279927f8956 Eric W. Biederman 2007-05-09 452 spin_unlock(&kthread_create_lock);
73c279927f8956 Eric W. Biederman 2007-05-09 453
cbd9b67bd3883d Dmitry Adamushko 2008-04-29 454 wake_up_process(kthreadd_task);
786235eeba0e1e Tetsuo Handa 2013-11-12 455 /*
786235eeba0e1e Tetsuo Handa 2013-11-12 456 * Wait for completion in killable state, for I might be chosen by
786235eeba0e1e Tetsuo Handa 2013-11-12 457 * the OOM killer while kthreadd is trying to allocate memory for
786235eeba0e1e Tetsuo Handa 2013-11-12 458 * new kernel thread.
786235eeba0e1e Tetsuo Handa 2013-11-12 459 */
786235eeba0e1e Tetsuo Handa 2013-11-12 460 if (unlikely(wait_for_completion_killable(&done))) {
786235eeba0e1e Tetsuo Handa 2013-11-12 461 /*
d25c83c6606ffc Petr Mladek 2022-03-15 462 * If I was killed by a fatal signal before kthreadd (or new
d25c83c6606ffc Petr Mladek 2022-03-15 463 * kernel thread) calls complete(), leave the cleanup of this
d25c83c6606ffc Petr Mladek 2022-03-15 464 * structure to that thread.
786235eeba0e1e Tetsuo Handa 2013-11-12 465 */
786235eeba0e1e Tetsuo Handa 2013-11-12 466 if (xchg(&create->done, NULL))
8fe6929cfd43c4 Tetsuo Handa 2014-06-04 467 return ERR_PTR(-EINTR);
786235eeba0e1e Tetsuo Handa 2013-11-12 468 /*
786235eeba0e1e Tetsuo Handa 2013-11-12 469 * kthreadd (or new kernel thread) will call complete()
786235eeba0e1e Tetsuo Handa 2013-11-12 470 * shortly.
786235eeba0e1e Tetsuo Handa 2013-11-12 471 */
786235eeba0e1e Tetsuo Handa 2013-11-12 472 wait_for_completion(&done);
786235eeba0e1e Tetsuo Handa 2013-11-12 473 }
786235eeba0e1e Tetsuo Handa 2013-11-12 474 task = create->result;
73e0c116594d99 Mike Christie 2023-03-10 475 free_create:
786235eeba0e1e Tetsuo Handa 2013-11-12 @476 kfree(create);
786235eeba0e1e Tetsuo Handa 2013-11-12 477 return task;
^1da177e4c3f41 Linus Torvalds 2005-04-16 478 }
255451e45345bc Petr Mladek 2016-10-11 479
:::::: The code at line 476 was first introduced by commit
:::::: 786235eeba0e1e85e5cbbb9f97d1087ad03dfa21 kthread: make kthread_create() killable
:::::: TO: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
:::::: CC: Linus Torvalds <torvalds@linux-foundation.org>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next reply other threads:[~2024-11-21 5:40 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-21 5:39 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2024-11-26 3:20 kernel/kthread.c:476 __kthread_create_on_node() warn: '&create->list' not removed from list kernel test robot
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=202411211332.mOnyrG5e-lkp@intel.com \
--to=lkp@intel.com \
--cc=error27@gmail.com \
--cc=oe-kbuild@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.