]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
software node: Allow node creation without properties
authorHeikki Krogerus <heikki.krogerus@linux.intel.com>
Fri, 31 May 2019 14:15:32 +0000 (17:15 +0300)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Mon, 3 Jun 2019 08:55:38 +0000 (10:55 +0200)
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 <heikki.krogerus@linux.intel.com>
Tested-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/base/swnode.c

index 7fc5a18e02ad5de5cf7269c79b33a7cecb3bfc21..30077454eb68053f01cc04eb83b3baa5b0805ca0 100644 (file)
@@ -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++;