fs/proc/namespaces.c: prevent crash when ns_entries[] is empty
authorAndrew Morton <akpm@linux-foundation.org>
Wed, 28 Mar 2012 21:42:52 +0000 (14:42 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 29 Mar 2012 00:14:37 +0000 (17:14 -0700)
commit4c619aa0ba171c092a0ae5d969364deb82dbe371
treebc710f9a419f1f87712f5fa4c341330f7293c3d8
parentf4507164e7796b66c371ff9a63154f1c884a2433
fs/proc/namespaces.c: prevent crash when ns_entries[] is empty

If CONFIG_NET_NS, CONFIG_UTS_NS and CONFIG_IPC_NS are disabled,
ns_entries[] becomes empty and things like
ns_entries[ARRAY_SIZE(ns_entries) - 1] will explode.

Reported-by: Richard Weinberger <richard@nod.at>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Daniel Lezcano <daniel.lezcano@free.fr>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
fs/proc/namespaces.c