]> err.no Git - linux-2.6/blobdiff - fs/sysfs/symlink.c
CGroup API files: use cgroup map for memcontrol stats file
[linux-2.6] / fs / sysfs / symlink.c
index 5f66c446615176eff46e1864a7343f228bac19e6..817f5966edcac2c2e36033902f2ac2ce0f89f626 100644 (file)
@@ -87,7 +87,14 @@ int sysfs_create_link(struct kobject * kobj, struct kobject * target, const char
 
 void sysfs_remove_link(struct kobject * kobj, const char * name)
 {
-       sysfs_hash_and_remove(kobj->sd, name);
+       struct sysfs_dirent *parent_sd = NULL;
+
+       if (!kobj)
+               parent_sd = &sysfs_root;
+       else
+               parent_sd = kobj->sd;
+
+       sysfs_hash_and_remove(parent_sd, name);
 }
 
 static int sysfs_get_target_path(struct sysfs_dirent *parent_sd,