diff options
author | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-01-10 06:47:01 -0500 |
---|---|---|
committer | Bjoern Brandenburg <bbb@mpi-sws.org> | 2013-02-04 09:24:58 -0500 |
commit | 4bd4eacab5070ac3003925b50a3d03069ae15e4a (patch) | |
tree | e660449bdf0740d9dee39de7840f0c6aaf19d635 | |
parent | 44b2be2bd7b1985345bf855bc74dfc303c7c79cb (diff) |
FDSO: fail to build if some ops are missing
Prevents out-of-bounds lookups.
-rw-r--r-- | litmus/fdso.c | 2 |
1 files changed, 2 insertions, 0 deletions
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[] = { | |||
31 | 31 | ||
32 | static int fdso_create(void** obj_ref, obj_type_t type, void* __user config) | 32 | static int fdso_create(void** obj_ref, obj_type_t type, void* __user config) |
33 | { | 33 | { |
34 | BUILD_BUG_ON(ARRAY_SIZE(fdso_ops) != MAX_OBJ_TYPE + 1); | ||
35 | |||
34 | if (fdso_ops[type]->create) | 36 | if (fdso_ops[type]->create) |
35 | return fdso_ops[type]->create(obj_ref, type, config); | 37 | return fdso_ops[type]->create(obj_ref, type, config); |
36 | else | 38 | else |