lkml.org 
[lkml]   [2021]   [Feb]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] lib: vsprintf: check for NULL device_node name in device_node_string()
On Wed, Feb 17, 2021 at 01:15:43PM +0100, Enrico Weigelt, metux IT consult wrote:
> Under rare circumstances it may happen that a device node's name is NULL
> (most likely kernel bug in some other place).

What circumstances? How can I reproduce this? More information, please!

> In such situations anything
> but helpful, if the debug printout crashes, and nobody knows what actually
> happened here.
>
> Therefore protect it by an explicit NULL check and print out an extra
> warning.

...

> + pr_warn("device_node without name. Kernel bug ?\n");

If it's not once, then it's possible to have log spammed with this, right?

...

> + p = "<NULL>";

We have different standard de facto for NULL pointers to be printed. Actually
if you wish, you may gather them under one definition (maybe somewhere under
printk) and export to everybody to use.

--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2021-02-17 14:53    [W:0.424 / U:0.272 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site