]> git.baikalelectronics.ru Git - kernel.git/commit
device property: Avoid NULL pointer dereference in device_get_next_child_node()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Thu, 16 Jul 2020 18:27:47 +0000 (21:27 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 23 Jul 2020 15:04:28 +0000 (17:04 +0200)
commit4458f273060d5b372c88334b59306f2f2ec0fddc
tree37ac94175f772e0597749dbbc84828610b7722d4
parent21d0a5cf950768933cb88e716f8a3bf1031bcec4
device property: Avoid NULL pointer dereference in device_get_next_child_node()

When we have no primary fwnode or when it's a software node, we may end up
in the situation when fwnode is a NULL pointer. There is no point to look for
secondary fwnode in such case. Add a necessary check to a condition.

Fixes: 1d20179d76d5 ("drivers property: When no children in primary, try secondary")
Reported-by: Maxim Levitsky <mlevitsk@redhat.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Maxim Levitsky <mlevitsk@redhat.com>
Link: https://lore.kernel.org/r/20200716182747.54929-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/property.c