mpol_parse_str() made lots 'err' variable related bug. Because it is ugly
and reviewing unfriendly.
This patch simplifies it.
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Cc: Ravikiran Thirumalai <kiran@scalex86.org>
Cc: Christoph Lameter <cl@linux-foundation.org>
Cc: Mel Gorman <mel@csn.ul.ie>
Acked-by: Lee Schermerhorn <lee.schermerhorn@hp.com>
Cc: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
char *rest = nodelist;
while (isdigit(*rest))
rest++;
char *rest = nodelist;
while (isdigit(*rest))
rest++;
}
break;
case MPOL_INTERLEAVE:
}
break;
case MPOL_INTERLEAVE:
*/
if (!nodelist)
nodes = node_states[N_HIGH_MEMORY];
*/
if (!nodelist)
nodes = node_states[N_HIGH_MEMORY];
break;
case MPOL_LOCAL:
/*
break;
case MPOL_LOCAL:
/*
if (nodelist)
goto out;
mode = MPOL_PREFERRED;
if (nodelist)
goto out;
mode = MPOL_PREFERRED;
break;
case MPOL_DEFAULT:
/*
break;
case MPOL_DEFAULT:
/*
*/
if (!nodelist)
goto out;
*/
if (!nodelist)
goto out;
else if (!strcmp(flags, "relative"))
mode_flags |= MPOL_F_RELATIVE_NODES;
else
else if (!strcmp(flags, "relative"))
mode_flags |= MPOL_F_RELATIVE_NODES;
else
}
new = mpol_new(mode, mode_flags, &nodes);
if (IS_ERR(new))
}
new = mpol_new(mode, mode_flags, &nodes);
if (IS_ERR(new))
int ret;
NODEMASK_SCRATCH(scratch);
if (scratch) {
int ret;
NODEMASK_SCRATCH(scratch);
if (scratch) {
ret = -ENOMEM;
NODEMASK_SCRATCH_FREE(scratch);
if (ret) {
ret = -ENOMEM;
NODEMASK_SCRATCH_FREE(scratch);
if (ret) {
- } else if (no_context) {
- /* save for contextualization */
- new->w.user_nodemask = nodes;
+ err = 0;
+ if (no_context) {
+ /* save for contextualization */
+ new->w.user_nodemask = nodes;
+ }
out:
/* Restore string for error message */
out:
/* Restore string for error message */