genode_c_api/usb: no policy check in session create

Fix genodelabs/genode#5357
This commit is contained in:
Stefan Kalkowski 2024-10-14 16:17:19 +02:00 committed by Christian Helmuth
parent 700b248749
commit a148dc5cb4

View File

@ -1521,18 +1521,13 @@ Session_component * ::Root::_create_session(const char * args,
{
Session_component * sc = nullptr;
try {
Session_label const label { session_label_from_args(args) };
Session_policy const policy { label, _config.xml() };
Session_label const label { session_label_from_args(args) };
sc = new (md_alloc())
Session_component(_env, *this, _sessions, _devices, _config,
_sigh_cap, _alloc_fn, _free_fn, _release_fn,
label, session_resources_from_args(args),
session_diag_from_args(args));
} catch (Session_policy::No_policy_defined) {
error("Invalid session request, no matching policy for ",
"'", label_from_args(args).string(), "'");
throw Service_denied();
} catch (...) {
if (sc) { Genode::destroy(md_alloc(), sc); }
throw;