[PATCH 3/3] bsps/irq: Use rtems_malloc()

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Nov 9 12:10:40 UTC 2018


---
 bsps/shared/irq/irq-generic.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/bsps/shared/irq/irq-generic.c b/bsps/shared/irq/irq-generic.c
index 10a9d184d6..fd129333ba 100644
--- a/bsps/shared/irq/irq-generic.c
+++ b/bsps/shared/irq/irq-generic.c
@@ -132,16 +132,21 @@ static inline bool bsp_interrupt_allocate_handler_index(
 
 static bsp_interrupt_handler_entry *bsp_interrupt_allocate_handler_entry(void)
 {
+  bsp_interrupt_handler_entry *e;
+
   #ifdef BSP_INTERRUPT_NO_HEAP_USAGE
     rtems_vector_number index = 0;
+
     if (bsp_interrupt_allocate_handler_index(0, &index)) {
-      return &bsp_interrupt_handler_table [index];
+      e = &bsp_interrupt_handler_table [index];
     } else {
-      return NULL;
+      e = NULL;
     }
   #else
-    return rtems_heap_allocate_aligned_with_boundary(sizeof(bsp_interrupt_handler_entry), 0, 0);
+    e = rtems_malloc(sizeof(*e));
   #endif
+
+  return e;
 }
 
 static void bsp_interrupt_free_handler_entry(bsp_interrupt_handler_entry *e)
-- 
2.16.4




More information about the devel mailing list