From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [rt-devel:linux-6.1.y-rt-rebase 21/51] kernel/printk/printk.c:2468 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy
Date: Sun, 19 Mar 2023 04:48:54 +0800 [thread overview]
Message-ID: <202303190425.BybcKB4L-lkp@intel.com> (raw)
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: John Ogness <john.ogness@linutronix.de>
CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git linux-6.1.y-rt-rebase
head: 90d96fee668dc306dd748393383c0fc74b798eee
commit: cf8dd889ea20ae7091d3b27029b07bef13298291 [21/51] serial: 8250: implement write_atomic
:::::: branch date: 4 weeks ago
:::::: commit date: 5 months ago
config: i386-randconfig-m021 (https://download.01.org/0day-ci/archive/20230319/202303190425.BybcKB4L-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-8) 11.3.0
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Link: https://lore.kernel.org/r/202303190425.BybcKB4L-lkp@intel.com/
smatch warnings:
kernel/printk/printk.c:2468 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy
vim +2468 kernel/printk/printk.c
09cbc4e64a7546 John Ogness 2022-02-04 2463
09cbc4e64a7546 John Ogness 2022-02-04 2464 static int __alloc_atomic_data(struct console_atomic_data *d, short flags)
09cbc4e64a7546 John Ogness 2022-02-04 2465 {
09cbc4e64a7546 John Ogness 2022-02-04 2466 d->text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL);
09cbc4e64a7546 John Ogness 2022-02-04 2467 if (!d->text)
09cbc4e64a7546 John Ogness 2022-02-04 @2468 return -1;
09cbc4e64a7546 John Ogness 2022-02-04 2469
09cbc4e64a7546 John Ogness 2022-02-04 2470 if (flags & CON_EXTENDED) {
09cbc4e64a7546 John Ogness 2022-02-04 2471 d->ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
09cbc4e64a7546 John Ogness 2022-02-04 2472 if (!d->ext_text)
09cbc4e64a7546 John Ogness 2022-02-04 2473 return -1;
09cbc4e64a7546 John Ogness 2022-02-04 2474 } else {
09cbc4e64a7546 John Ogness 2022-02-04 2475 d->dropped_text = kmalloc(DROPPED_TEXT_MAX, GFP_KERNEL);
09cbc4e64a7546 John Ogness 2022-02-04 2476 if (!d->dropped_text)
09cbc4e64a7546 John Ogness 2022-02-04 2477 return -1;
09cbc4e64a7546 John Ogness 2022-02-04 2478 }
09cbc4e64a7546 John Ogness 2022-02-04 2479
09cbc4e64a7546 John Ogness 2022-02-04 2480 return 0;
09cbc4e64a7546 John Ogness 2022-02-04 2481 }
09cbc4e64a7546 John Ogness 2022-02-04 2482
:::::: The code at line 2468 was first introduced by commit
:::::: 09cbc4e64a7546900af52b0007997930b37bfeb4 printk: add infrastucture for atomic consoles
:::::: TO: John Ogness <john.ogness@linutronix.de>
:::::: CC: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
next reply other threads:[~2023-03-18 20:49 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-18 20:48 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-08-28 3:15 [rt-devel:linux-6.1.y-rt-rebase 21/51] kernel/printk/printk.c:2468 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy kernel test robot
2023-09-05 9:43 Dan Carpenter
2023-09-06 6:56 ` Sebastian Andrzej Siewior
2023-09-08 15:19 ` Sebastian Andrzej Siewior
2023-09-08 16:15 ` Dan Carpenter
2023-09-08 16:21 ` Sebastian Andrzej Siewior
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=202303190425.BybcKB4L-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.