[rtems commit] bsps/irq: Canonicalize get/set affinity errors
Sebastian Huber
sebh at rtems.org
Tue Jul 27 05:42:40 UTC 2021
Module: rtems
Branch: master
Commit: 1b3b5b8428fbfee9253a978c9d63ef47663e23bb
Changeset: http://git.rtems.org/rtems/commit/?id=1b3b5b8428fbfee9253a978c9d63ef47663e23bb
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Jul 6 08:39:01 2021 +0200
bsps/irq: Canonicalize get/set affinity errors
Bring the error conditions and status in line with
rtems_task_get_affinity() and rtems_task_set_affinity().
Update #3269.
---
bsps/shared/irq/irq-affinity.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/bsps/shared/irq/irq-affinity.c b/bsps/shared/irq/irq-affinity.c
index f750d6b..d2214cf 100644
--- a/bsps/shared/irq/irq-affinity.c
+++ b/bsps/shared/irq/irq-affinity.c
@@ -47,13 +47,17 @@ rtems_status_code rtems_interrupt_set_affinity(
Processor_mask set;
Processor_mask_Copy_status status;
+ if ( affinity == NULL ) {
+ return RTEMS_INVALID_ADDRESS;
+ }
+
if (!bsp_interrupt_is_valid_vector(vector)) {
return RTEMS_INVALID_ID;
}
status = _Processor_mask_From_cpu_set_t(&set, affinity_size, affinity);
- if (status != PROCESSOR_MASK_COPY_LOSSLESS) {
- return RTEMS_INVALID_SIZE;
+ if ( !_Processor_mask_Is_at_most_partial_loss( status ) ) {
+ return RTEMS_INVALID_NUMBER;
}
#if defined(RTEMS_SMP)
@@ -71,6 +75,10 @@ rtems_status_code rtems_interrupt_get_affinity(
Processor_mask set;
Processor_mask_Copy_status status;
+ if ( affinity == NULL ) {
+ return RTEMS_INVALID_ADDRESS;
+ }
+
if (!bsp_interrupt_is_valid_vector(vector)) {
return RTEMS_INVALID_ID;
}
More information about the vc
mailing list