|
@@ -756,24 +756,19 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
|
|
struct nameidata *nd)
|
|
struct nameidata *nd)
|
|
{
|
|
{
|
|
struct dentry *ret = NULL;
|
|
struct dentry *ret = NULL;
|
|
- struct sysfs_dirent * parent_sd = dentry->d_parent->d_fsdata;
|
|
|
|
- struct sysfs_dirent * sd;
|
|
|
|
|
|
+ struct sysfs_dirent *parent_sd = dentry->d_parent->d_fsdata;
|
|
|
|
+ struct sysfs_dirent *sd;
|
|
struct bin_attribute *bin_attr;
|
|
struct bin_attribute *bin_attr;
|
|
struct inode *inode;
|
|
struct inode *inode;
|
|
- int found = 0;
|
|
|
|
|
|
|
|
mutex_lock(&sysfs_mutex);
|
|
mutex_lock(&sysfs_mutex);
|
|
|
|
|
|
- for (sd = parent_sd->s_children; sd; sd = sd->s_sibling) {
|
|
|
|
- if (sysfs_type(sd) &&
|
|
|
|
- !strcmp(sd->s_name, dentry->d_name.name)) {
|
|
|
|
- found = 1;
|
|
|
|
|
|
+ for (sd = parent_sd->s_children; sd; sd = sd->s_sibling)
|
|
|
|
+ if (sysfs_type(sd) && !strcmp(sd->s_name, dentry->d_name.name))
|
|
break;
|
|
break;
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
|
|
/* no such entry */
|
|
/* no such entry */
|
|
- if (!found)
|
|
|
|
|
|
+ if (!sd)
|
|
goto out_unlock;
|
|
goto out_unlock;
|
|
|
|
|
|
/* attach dentry and inode */
|
|
/* attach dentry and inode */
|