All of lore.kernel.org
 help / color / mirror / Atom feed
* [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
@ 2023-08-28  3:15 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-08-28  3:15 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

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: 6 months ago
:::::: commit date: 10 months ago
config: i386-randconfig-141-20230828 (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/reproduce)

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/202308281100.1LIdaKaP-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/wiki

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [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
  2023-09-08 16:15   ` Dan Carpenter
@ 2023-09-08 16:21     ` Sebastian Andrzej Siewior
  0 siblings, 0 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2023-09-08 16:21 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: oe-kbuild, John Ogness, lkp, oe-kbuild-all

On 2023-09-08 19:15:31 [+0300], Dan Carpenter wrote:
> Forget about it.  This doesn't matter at all.  I thought since kbuild
> was reporting it then the code was new.  Sorry for the noise.

Okay, no worries.
If you find something in the for-kbuild-bot/current-stable branch I'm
all yours.

> regards,
> dan carpenter

Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [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
  2023-09-08 15:19 ` Sebastian Andrzej Siewior
@ 2023-09-08 16:15   ` Dan Carpenter
  2023-09-08 16:21     ` Sebastian Andrzej Siewior
  0 siblings, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2023-09-08 16:15 UTC (permalink / raw)
  To: Sebastian Andrzej Siewior; +Cc: oe-kbuild, John Ogness, lkp, oe-kbuild-all

On Fri, Sep 08, 2023 at 05:19:24PM +0200, Sebastian Andrzej Siewior wrote:
> On 2023-09-05 12:43:35 [+0300], Dan Carpenter wrote:
> > 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
> > config: i386-randconfig-141-20230828 (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/config)
> > compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
> > reproduce: (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/reproduce)
> 
> Now that I looked again at it. The 6.1 is outdated and no longer
> updated. The -1 vs -ENOMEM is not present in the v6.5 series which
> current so I can't fix it there…
> 
> The 6.1 tree itself is stable maintained. If you want this fixed in the
> stable tree for 6.1
> 	https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git
> 
> and I assume it is there, then I would send Clark a patch…

Forget about it.  This doesn't matter at all.  I thought since kbuild
was reporting it then the code was new.  Sorry for the noise.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [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
  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
  1 sibling, 1 reply; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2023-09-08 15:19 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: oe-kbuild, John Ogness, lkp, oe-kbuild-all

On 2023-09-05 12:43:35 [+0300], Dan Carpenter wrote:
> 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
> config: i386-randconfig-141-20230828 (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/config)
> compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/reproduce)

Now that I looked again at it. The 6.1 is outdated and no longer
updated. The -1 vs -ENOMEM is not present in the v6.5 series which
current so I can't fix it there…

The 6.1 tree itself is stable maintained. If you want this fixed in the
stable tree for 6.1
	https://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-stable-rt.git

and I assume it is there, then I would send Clark a patch…

Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [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
  2023-09-05  9:43 Dan Carpenter
@ 2023-09-06  6:56 ` Sebastian Andrzej Siewior
  2023-09-08 15:19 ` Sebastian Andrzej Siewior
  1 sibling, 0 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2023-09-06  6:56 UTC (permalink / raw)
  To: John Ogness; +Cc: oe-kbuild, Dan Carpenter, lkp, oe-kbuild-all

On 2023-09-05 12:43:35 [+0300], Dan Carpenter wrote:
> 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  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;
> 
> Just return -ENOMEM.  Even if it doesn't get passed back to the user,
> it's just better to do things in a normal way.

John, are you going to integrate this or did you rewrite the code to the
point that it has been "fixed"?

Sebastian

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [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
@ 2023-09-05  9:43 Dan Carpenter
  2023-09-06  6:56 ` Sebastian Andrzej Siewior
  2023-09-08 15:19 ` Sebastian Andrzej Siewior
  0 siblings, 2 replies; 7+ messages in thread
From: Dan Carpenter @ 2023-09-05  9:43 UTC (permalink / raw)
  To: oe-kbuild, John Ogness; +Cc: lkp, oe-kbuild-all, Sebastian Andrzej Siewior

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
config: i386-randconfig-141-20230828 (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/config)
compiler: gcc-11 (Debian 11.3.0-12) 11.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230828/202308281100.1LIdaKaP-lkp@intel.com/reproduce)

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 <dan.carpenter@linaro.org>
| Closes: https://lore.kernel.org/r/202308281100.1LIdaKaP-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  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;

Just return -ENOMEM.  Even if it doesn't get passed back to the user,
it's just better to do things in a normal way.

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  }

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [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
@ 2023-03-18 20:48 kernel test robot
  0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2023-03-18 20:48 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2023-09-08 16:21 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
  -- strict thread matches above, loose matches on Subject: below --
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
2023-03-18 20:48 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.