X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=fs%2Fsysfs%2Fsymlink.c;h=817f5966edcac2c2e36033902f2ac2ce0f89f626;hb=c64745cf0f34f2cb08fc28c93d844e583d0d591d;hp=5f66c446615176eff46e1864a7343f228bac19e6;hpb=dd07a8db7283f52f347aee468007556944b5b393;p=linux-2.6 diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c index 5f66c44661..817f5966ed 100644 --- a/fs/sysfs/symlink.c +++ b/fs/sysfs/symlink.c @@ -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,