mm/mempolicy: Fix error code in sysfs_wi_node_add()
Subsystems (3)
PATCH v2 1/1 mm/mempolicy: Fix error code in sysfs_wi_node_add()
Smatch complains that there is a missing error code here. Arguments could be made either way about what correct behavior should be but in the end we decided that returning -EINVAL probably made sense.
The wi_node_notifier() already prints an error so this pr_info() is duplicative so delete it.
Fixes bc7527e0a127 ("mm/mempolicy: support memory hotplug in weighted interleave")
Signed-off-by Dan Carpenter <[email protected]>
Reviewed-by Joshua Hahn <[email protected]>
Reviewed-by Honggyu Kim <[email protected]>
Reviewed-by Rakie Kim <[email protected]>
---
v2: Delete the pr_info() message as well
mm/mempolicy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/mempolicy.c +2 -2
@@ -3539,7 +3539,7 @@ static const struct kobj_type wi_ktype = {static int sysfs_wi_node_add (int nid) { -int ret =0 ; +int ret;char *name;struct iw_node_attr *new_attr;
@@ -3568,7 +3568,7 @@ static int sysfs_wi_node_add(int nid)mutex_lock (&wi_group->kobj_lock);if (wi_group->nattrs[nid]) {mutex_unlock (&wi_group->kobj_lock); -pr_info ("node%d already exists\n" , nid); + ret = -EEXIST ; goto out; }
Signature · 1 line
2.47.2