aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/sysfs/dir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 8ddc1021c79a..35a36d39fa2c 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -729,6 +729,9 @@ int sysfs_create_dir(struct kobject * kobj)
729 else 729 else
730 parent_sd = &sysfs_root; 730 parent_sd = &sysfs_root;
731 731
732 if (!parent_sd)
733 return -ENOENT;
734
732 if (sysfs_ns_type(parent_sd)) 735 if (sysfs_ns_type(parent_sd))
733 ns = kobj->ktype->namespace(kobj); 736 ns = kobj->ktype->namespace(kobj);
734 type = sysfs_read_ns_type(kobj); 737 type = sysfs_read_ns_type(kobj);