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 460d6b3
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions repos/base-foc/src/core/irq_session_component.cc
Expand Up @@ -199,8 +199,18 @@ 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);
}
throw Service_denied();
}


Expand Down

2 comments on commit 460d6b3

@alex-ab
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@cnuke: please add to staging

@cnuke
Copy link

@cnuke cnuke commented on 460d6b3 Jul 26, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alex-ab done.

Please sign in to comment.