From 4bd4eacab5070ac3003925b50a3d03069ae15e4a Mon Sep 17 00:00:00 2001 From: Bjoern Brandenburg Date: Thu, 10 Jan 2013 12:47:01 +0100 Subject: FDSO: fail to build if some ops are missing Prevents out-of-bounds lookups. --- litmus/fdso.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/litmus/fdso.c b/litmus/fdso.c index 250377d184e7..c4b450be4509 100644 --- a/litmus/fdso.c +++ b/litmus/fdso.c @@ -31,6 +31,8 @@ static const struct fdso_ops* fdso_ops[] = { static int fdso_create(void** obj_ref, obj_type_t type, void* __user config) { + BUILD_BUG_ON(ARRAY_SIZE(fdso_ops) != MAX_OBJ_TYPE + 1); + if (fdso_ops[type]->create) return fdso_ops[type]->create(obj_ref, type, config); else -- cgit v1.2.2