aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 83afc8b8f27b..282025770429 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -909,8 +909,10 @@ int device_add(struct device *dev)
909 dev->init_name = NULL; 909 dev->init_name = NULL;
910 } 910 }
911 911
912 if (!dev_name(dev)) 912 if (!dev_name(dev)) {
913 error = -EINVAL;
913 goto name_error; 914 goto name_error;
915 }
914 916
915 pr_debug("device: '%s': %s\n", dev_name(dev), __func__); 917 pr_debug("device: '%s': %s\n", dev_name(dev), __func__);
916 918