summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/platform.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 3f8077ce585c..ddeca142293c 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -103,6 +103,9 @@ struct resource *platform_get_resource_byname(struct platform_device *dev,
for (i = 0; i < dev->num_resources; i++) {
struct resource *r = &dev->resource[i];
+ if (unlikely(!r->name))
+ continue;
+
if (type == resource_type(r) && !strcmp(r->name, name))
return r;
}