lkml.org 
[lkml]   [2024]   [Feb]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] irqchip/mbigen: Fix incorrect null pointer check
Date
Chen!

On Mon, Feb 19 2024 at 16:53, 陈骏 wrote:
> From: Chen Jun <chenjun102@huawei.com>

As I said before, the subject line does not make sense. This is not
about an incorrect NULL pointer check. It's about using a function which
is guaranteed to return NULL on your platform. Something like:

irqchip/mbigen: Don't use bus_get_dev_root() to find the parent

makes it pretty clear what this is about.

> bus_get_dev_root returns sp->dev_root set in subsys_register.
> And subsys_register is not called by platform_bus_init.

Please use '()' when referencing functions. See:

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#function-references-in-changelogs

> For platform_bus_type, bus_get_dev_root always returns NULL.
> This makes mbigen_of_create_domain always return -ENODEV.

This lacks an information how the above problem is solved,
i.e. something like:

Don't try to retrieve the parent via bus_get_dev_root() and
unconditionally hand a NULL pointer to of_platform_device_create() to
fix this.

Hmm?

> Fixes: fea087fc291b ("irqchip/mbigen: move to use bus_get_dev_root()")
> Signed-off-by: Chen Jun <chenjun102@huawei.com>

Needs a

Cc: stable@vger.kernel.org

under the Signed-off-by tag.

Thanks,

tglx

\
 
 \ /
  Last update: 2024-05-27 15:10    [W:0.061 / U:0.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site