|
@@ -285,7 +285,7 @@ void sysfs_drop_dentry(struct sysfs_dirent *sd)
|
|
int sysfs_hash_and_remove(struct dentry * dir, const char * name)
|
|
int sysfs_hash_and_remove(struct dentry * dir, const char * name)
|
|
{
|
|
{
|
|
struct sysfs_dirent **pos, *sd;
|
|
struct sysfs_dirent **pos, *sd;
|
|
- struct sysfs_dirent *parent_sd = dir->d_fsdata;
|
|
|
|
|
|
+ struct sysfs_dirent *parent_sd;
|
|
int found = 0;
|
|
int found = 0;
|
|
|
|
|
|
if (!dir)
|
|
if (!dir)
|
|
@@ -295,6 +295,7 @@ int sysfs_hash_and_remove(struct dentry * dir, const char * name)
|
|
/* no inode means this hasn't been made visible yet */
|
|
/* no inode means this hasn't been made visible yet */
|
|
return -ENOENT;
|
|
return -ENOENT;
|
|
|
|
|
|
|
|
+ parent_sd = dir->d_fsdata;
|
|
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
|
|
mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
|
|
for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
|
|
for (pos = &parent_sd->s_children; *pos; pos = &(*pos)->s_sibling) {
|
|
sd = *pos;
|
|
sd = *pos;
|