aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJavi Merino <javi.merino@arm.com>2015-01-15 11:17:45 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-02-03 18:50:31 -0500
commitadf305f77878880fa5868a7179979da93be68d83 (patch)
treef87b173d3848b06bbe620142452803c64b78723c /fs
parent68ff2a00dbf590dc9483c20f85fd1f1faa054604 (diff)
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 <bonbons@linux-vserver.org> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Javi Merino <javi.merino@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/sysfs/group.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/sysfs/group.c b/fs/sysfs/group.c
index 7d2a860ba788..2554d8835b48 100644
--- a/fs/sysfs/group.c
+++ b/fs/sysfs/group.c
@@ -99,7 +99,7 @@ static int internal_create_group(struct kobject *kobj, int update,
99 return -EINVAL; 99 return -EINVAL;
100 if (!grp->attrs && !grp->bin_attrs) { 100 if (!grp->attrs && !grp->bin_attrs) {
101 WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n", 101 WARN(1, "sysfs: (bin_)attrs not set by subsystem for group: %s/%s\n",
102 kobj->name, grp->name ? "" : grp->name); 102 kobj->name, grp->name ?: "");
103 return -EINVAL; 103 return -EINVAL;
104 } 104 }
105 if (grp->name) { 105 if (grp->name) {