From: Heikki Krogerus Date: Fri, 31 May 2019 14:15:32 +0000 (+0300) Subject: software node: Allow node creation without properties X-Git-Tag: v5.3-rc1~165^2~16 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=a79969868a308b3cc7abda02e1526d37dacdee27;p=linux.git software node: Allow node creation without properties Software nodes are not forced to have device properties. Adding check to property_entries_dup() to make it possible to create software nodes that don't have any properties. Signed-off-by: Heikki Krogerus Tested-by: Hans de Goede Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/base/swnode.c b/drivers/base/swnode.c index 7fc5a18e02ad..30077454eb68 100644 --- a/drivers/base/swnode.c +++ b/drivers/base/swnode.c @@ -383,6 +383,9 @@ property_entries_dup(const struct property_entry *properties) int i, n = 0; int ret; + if (!properties) + return NULL; + while (properties[n].name) n++;