mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 18:51:56 -04:00
sysfs: fix warning when creating a sysfs group without attributes
When attempting to create a gropu without attrs, the warning prints the name of the group. However, the check for name being a NULL pointer is wrong: it uses the pointer to the name when it's NULL. Fix it to use the name if present, otherwise just put an empty string. Cc: Bruno Prémont <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Signed-off-by: Javi Merino <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
parent
68ff2a00db
commit
adf305f778
1 changed files with 1 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ static int internal_create_group(struct kobject *kobj, int update,
|
|||
return -EINVAL;
|
||||
if (!grp->attrs && !grp->bin_attrs) {
|
||||
WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n",
|
||||
kobj->name, grp->name ? "" : grp->name);
|
||||
kobj->name, grp->name ?: "");
|
||||
return -EINVAL;
|
||||
}
|
||||
if (grp->name) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue