diff options
author | Jiannan Guo <guojiannan1101@gmail.com> | 2016-11-03 02:30:48 +0800 |
---|---|---|
committer | Paul Moore <paul@paul-moore.com> | 2017-02-02 19:33:51 -0500 |
commit | 75da81e9ae7d5995f0a44673d4a737dafc05c11a (patch) | |
tree | 00003875a4c0d0d7ce599bcae084790de818fcd6 | |
parent | 116b3c1a2e1db53cc35b74f30c080f5265faa674 (diff) | |
download | libseccomp-75da81e9ae7d5995f0a44673d4a737dafc05c11a.tar.gz |
arch: removed unnecessary call in `seccomp_add_arch`.
Some logic in the implementation of `seccomp_add_arch` can never
be reached and `arch_def_lookup` was called redundantly.
Signed-off-by: Jiannan Guo <guojiannan1101@gmail.com>
[PM: update subject line]
Signed-off-by: Paul Moore <paul@paul-moore.com>
-rw-r--r-- | src/api.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -168,14 +168,12 @@ API int seccomp_arch_add(scmp_filter_ctx ctx, uint32_t arch_token) if (arch_token == 0) arch_token = arch_def_native->token; - if (arch_valid(arch_token)) + arch = arch_def_lookup(arch_token); + if (arch == NULL) return -EINVAL; if (db_col_arch_exist(col, arch_token)) return -EEXIST; - arch = arch_def_lookup(arch_token); - if (arch == NULL) - return -EFAULT; return db_col_db_new(col, arch); } |