diff options
| author | David Rientjes <[email protected]> | 2013-11-12 15:07:28 -0800 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2013-11-13 12:09:05 +0900 |
| commit | 948927ee9e4f35f287e61a79c9f0e85ca2202c7d (patch) | |
| tree | 611c78ab8b15b7ed1bb1e03791711bfb8f19edf5 /tools/perf/scripts/python/net_dropmonitor.py | |
| parent | 40c3baa7c66f1352521378ee83509fb8f4c465de (diff) | |
mm, mempolicy: make mpol_to_str robust and always succeed
mpol_to_str() should not fail. Currently, it either fails because the
string buffer is too small or because a string hasn't been defined for a
mempolicy mode.
If a new mempolicy mode is introduced and no string is defined for it,
just warn and return "unknown".
If the buffer is too small, just truncate the string and return, the
same behavior as snprintf().
This also fixes a bug where there was no NULL-byte termination when doing
*p++ = '=' and *p++ ':' and maxlen has been reached.
Signed-off-by: David Rientjes <[email protected]>
Cc: KOSAKI Motohiro <[email protected]>
Cc: Chen Gang <[email protected]>
Cc: Rik van Riel <[email protected]>
Cc: Dave Jones <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/net_dropmonitor.py')
0 files changed, 0 insertions, 0 deletions