aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-10-14 13:16:35 +0200
committerMax <msuraev@sysmocom.de>2016-10-24 08:43:30 +0000
commit5a4f4d12e14c23073644a3717f62949bc822db1f (patch)
tree38a32b68f66aebe19330c2a5526c75d130ceed50
parentc22da59342ed239b5dff4b6572dfcf45c634b251 (diff)
DTX HR - fix array size calculation
Use ARRAY_SIZE macro for each pointer separately. Fix suggested by Neels Hofmeyr <nhofmeyr@sysmocom.de>. Change-Id: I68ec1be33fb743977121d654187d85d6b8451e2b Fixes: Coverity CID 150132
-rw-r--r--src/common/msg_utils.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c
index f00a71ac..393ae908 100644
--- a/src/common/msg_utils.c
+++ b/src/common/msg_utils.c
@@ -260,7 +260,8 @@ static inline bool dtx_sched_optional(struct gsm_lchan *lchan, uint32_t fn)
return fn_chk(f, fn, ARRAY_SIZE(f));
else
return fn_chk(lchan->nr ? h1 : h0, fn,
- ARRAY_SIZE(lchan->nr ? h1 : h0));
+ lchan->nr ? ARRAY_SIZE(h1) :
+ ARRAY_SIZE(h0));
}
return false;
}