Skip to content

Commit

Permalink
foc: deny irq session creation on failure
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-ab committed Jul 20, 2018
1 parent ac6665b commit e3f8663
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions repos/base-foc/src/core/irq_session_component.cc
Expand Up @@ -199,8 +199,17 @@ Irq_session_component::Irq_session_component(Range_allocator *irq_alloc,
}

Irq_args const irq_args(args);
_irq_object.associate(_irq_number, msi, irq_args.trigger(),
irq_args.polarity());
if (_irq_object.associate(_irq_number, msi, irq_args.trigger(),
irq_args.polarity()))
return;

/* cleanup */
if (msi)
msi_alloc.clear(_irq_number, 1);
else {
addr_t const free_irq = _irq_number;
_irq_alloc->free((void *)free_irq);
}
}


Expand Down

0 comments on commit e3f8663

Please sign in to comment.