Commit 024d8811 authored by Maneesh Soni's avatar Maneesh Soni Committed by Greg Kroah-Hartman

[PATCH] sysfs: fix duplicate driver registration error

o Do not release existing directory if the new directory happens to be a
  duplicate directory. Thanks to Kay Sievers for the testcase.
Signed-off-by: default avatarManeesh Soni <maneesh@in.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 3441a749
...@@ -111,7 +111,7 @@ static int create_dir(struct kobject * k, struct dentry * p, ...@@ -111,7 +111,7 @@ static int create_dir(struct kobject * k, struct dentry * p,
d_rehash(*d); d_rehash(*d);
} }
} }
if (error) if (error && (error != -EEXIST))
d_drop(*d); d_drop(*d);
dput(*d); dput(*d);
} else } else
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment