All of lore.kernel.org
 help / color / mirror / Atom feed
* [rt-devel:linux-5.16.y-rt-rebase 16/132] kernel/printk/printk.c:2339 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy
@ 2022-01-22  5:08 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2022-01-22  5:08 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 2702 bytes --]

CC: kbuild-all(a)lists.01.org
CC: linux-kernel(a)vger.kernel.org
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-5.16.y-rt-rebase
head:   1722f531f5244c70dcd9687c40729860bb254e8d
commit: e1fd5438186d729df636919574f08231f7ecdd1d [16/132] serial: 8250: implement write_atomic
:::::: branch date: 11 hours ago
:::::: commit date: 11 hours ago
config: x86_64-randconfig-m001-20220117 (https://download.01.org/0day-ci/archive/20220122/202201221259.fzbUIBAU-lkp(a)intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
kernel/printk/printk.c:2339 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy

vim +2339 kernel/printk/printk.c

02489ebe320634 John Ogness 2021-12-22  2334  
02489ebe320634 John Ogness 2021-12-22  2335  static int __alloc_atomic_data(struct console_atomic_data *d, short flags)
02489ebe320634 John Ogness 2021-12-22  2336  {
02489ebe320634 John Ogness 2021-12-22  2337  	d->text = kmalloc(CONSOLE_LOG_MAX, GFP_KERNEL);
02489ebe320634 John Ogness 2021-12-22  2338  	if (!d->text)
02489ebe320634 John Ogness 2021-12-22 @2339  		return -1;
02489ebe320634 John Ogness 2021-12-22  2340  
02489ebe320634 John Ogness 2021-12-22  2341  	if (flags & CON_EXTENDED) {
02489ebe320634 John Ogness 2021-12-22  2342  		d->ext_text = kmalloc(CONSOLE_EXT_LOG_MAX, GFP_KERNEL);
02489ebe320634 John Ogness 2021-12-22  2343  		if (!d->ext_text)
02489ebe320634 John Ogness 2021-12-22  2344  			return -1;
02489ebe320634 John Ogness 2021-12-22  2345  	} else {
02489ebe320634 John Ogness 2021-12-22  2346  		d->dropped_text = kmalloc(DROPPED_TEXT_MAX, GFP_KERNEL);
02489ebe320634 John Ogness 2021-12-22  2347  		if (!d->dropped_text)
02489ebe320634 John Ogness 2021-12-22  2348  			return -1;
02489ebe320634 John Ogness 2021-12-22  2349  	}
02489ebe320634 John Ogness 2021-12-22  2350  
02489ebe320634 John Ogness 2021-12-22  2351  	return 0;
02489ebe320634 John Ogness 2021-12-22  2352  }
02489ebe320634 John Ogness 2021-12-22  2353  

:::::: The code at line 2339 was first introduced by commit
:::::: 02489ebe320634155c5ddb3110d7d456fa68d304 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, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-01-22  5:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-01-22  5:08 [rt-devel:linux-5.16.y-rt-rebase 16/132] kernel/printk/printk.c:2339 __alloc_atomic_data() warn: returning -1 instead of -ENOMEM is sloppy kernel test robot

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.