Commit 1ed10aa8 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core-2.6:
  class: Free the class private data in class_release
  sysfs: sysfs_sd_setattr set iattrs unconditionally
parents 5d677670 18d19c96
...@@ -59,6 +59,8 @@ static void class_release(struct kobject *kobj) ...@@ -59,6 +59,8 @@ static void class_release(struct kobject *kobj)
else else
pr_debug("class '%s' does not have a release() function, " pr_debug("class '%s' does not have a release() function, "
"be careful\n", class->name); "be careful\n", class->name);
kfree(cp);
} }
static struct sysfs_ops class_sysfs_ops = { static struct sysfs_ops class_sysfs_ops = {
......
...@@ -81,7 +81,7 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) ...@@ -81,7 +81,7 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr)
if (!sd_attrs) if (!sd_attrs)
return -ENOMEM; return -ENOMEM;
sd->s_iattr = sd_attrs; sd->s_iattr = sd_attrs;
} else { }
/* attributes were changed at least once in past */ /* attributes were changed at least once in past */
iattrs = &sd_attrs->ia_iattr; iattrs = &sd_attrs->ia_iattr;
...@@ -99,7 +99,6 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr) ...@@ -99,7 +99,6 @@ int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr * iattr)
umode_t mode = iattr->ia_mode; umode_t mode = iattr->ia_mode;
iattrs->ia_mode = sd->s_mode = mode; iattrs->ia_mode = sd->s_mode = mode;
} }
}
return 0; return 0;
} }
......
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