]> git.baikalelectronics.ru Git - kernel.git/commit
mm: fix off-by-one bug in print_nodes_state()
authorRyota Ozaki <ozaki.ryota@gmail.com>
Tue, 29 May 2012 22:06:20 +0000 (15:06 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 29 May 2012 23:22:19 +0000 (16:22 -0700)
commitc95f0c1b9f0d436de002999806395132d4622d36
tree734af4486b123cb15b6a5b49f37db24c74d82c5c
parent9078b13bc097016a5dd5e7205dd301572a2228f0
mm: fix off-by-one bug in print_nodes_state()

/sys/devices/system/node/{online,possible} outputs a garbage byte
because print_nodes_state() returns content size + 1.  To fix the bug,
the patch changes the use of cpuset_sprintf_cpulist to follow the use at
other places, which is clearer and safer.

This bug was introduced in v2.6.24 (commit c30bdd2bdf74: "mm: add node
states sysfs class attributeS").

Signed-off-by: Ryota Ozaki <ozaki.ryota@gmail.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/base/node.c