diff options
author | Soby Mathew <soby.mathew@arm.com> | 2016-07-26 16:09:44 +0100 |
---|---|---|
committer | Soby Mathew <soby.mathew@arm.com> | 2016-07-26 16:39:19 +0100 |
commit | 5e5e41625ee4b9cc2aa9117c6764e42cdcf84eb0 (patch) | |
tree | 1424d8bcd7ababf345f61a7ea1749e91a171dc9d /common/runtime_svc.c | |
parent | 3dd9835f8ab3c2e7f57ddc92505d6c800bbacd47 (diff) | |
download | arm-trusted-firmware-5e5e41625ee4b9cc2aa9117c6764e42cdcf84eb0.tar.gz |
Improve debug assertion for runtime svc number
This patch improves the debug assertion for runtime svc number
- Remove useless comparison ensuring that the number of descriptors
is a positive number. The variable is an unsigned integer so can't
be negative.
- Check that the end address of the descriptors is sane relative
to the start address.
Change-Id: Iea7be6b34e33b8b1cbd394eb923cc834ea964831
Diffstat (limited to 'common/runtime_svc.c')
-rw-r--r-- | common/runtime_svc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/common/runtime_svc.c b/common/runtime_svc.c index 8729e2920..337421bcc 100644 --- a/common/runtime_svc.c +++ b/common/runtime_svc.c @@ -87,7 +87,8 @@ void runtime_svc_init(void) int rc = 0, index, start_idx, end_idx; /* Assert the number of descriptors detected are less than maximum indices */ - assert((RT_SVC_DECS_NUM >= 0) && (RT_SVC_DECS_NUM < MAX_RT_SVCS)); + assert((RT_SVC_DESCS_END >= RT_SVC_DESCS_START) && + (RT_SVC_DECS_NUM < MAX_RT_SVCS)); /* If no runtime services are implemented then simply bail out */ if (RT_SVC_DECS_NUM == 0) |