diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-10 12:42:11 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2021-08-12 10:09:04 +0200 |
commit | 9399e12c217343545bf412a01629570377536b39 (patch) | |
tree | e8a7f068a355bd18d15e745eec7b3c1611ae2f57 /cpukit/rtems/src/partcreate.c | |
parent | bsps/arm: More robust SMP start (diff) | |
download | rtems-9399e12c217343545bf412a01629570377536b39.tar.bz2 |
rtems: Fix rtems_partition_return_buffer()
The rtems_partition_return_buffer() wrongly accepted which were exactly
at the buffer area end. Use the buffer area limit address for the range
checking.
Close #4490.
Diffstat (limited to 'cpukit/rtems/src/partcreate.c')
-rw-r--r-- | cpukit/rtems/src/partcreate.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpukit/rtems/src/partcreate.c b/cpukit/rtems/src/partcreate.c index 012a416a1a..61249749f3 100644 --- a/cpukit/rtems/src/partcreate.c +++ b/cpukit/rtems/src/partcreate.c @@ -23,6 +23,7 @@ #include <rtems/rtems/partimpl.h> #include <rtems/rtems/attrimpl.h> #include <rtems/rtems/support.h> +#include <rtems/score/address.h> #include <rtems/score/chainimpl.h> #include <rtems/score/sysstate.h> #include <rtems/sysinit.h> @@ -40,8 +41,11 @@ static void _Partition_Initialize( rtems_attribute attribute_set ) { - the_partition->starting_address = starting_address; - the_partition->length = length; + const void *limit_address; + + limit_address = _Addresses_Add_offset( starting_address, length - 1 ); + the_partition->base_address = starting_address; + the_partition->limit_address = limit_address; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; |