diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2017-10-16 22:00:39 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2017-12-05 10:58:29 +0100 |
commit | 5b3baa02d368aa2cb41420f62af712fa29837f2b (patch) | |
tree | 77807f98774224cbe58582acf1a2efb74168e0bd /src/mm-filter.c | |
parent | c4bf785d6771764cbee116e36c6780462223c4fa (diff) |
filter: explicitly allow port when ID_MM_PLATFORM_DRIVER_PROBE is set
Don't assume that the port will be implicitly allowed afterwards.
Diffstat (limited to 'src/mm-filter.c')
-rw-r--r-- | src/mm-filter.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/mm-filter.c b/src/mm-filter.c index cdf60c5f..50a7dffa 100644 --- a/src/mm-filter.c +++ b/src/mm-filter.c @@ -100,10 +100,13 @@ mm_filter_port (MMFilter *self, /* If the physdev is a 'platform' or 'pnp' device that's not whitelisted, ignore it */ physdev_subsystem = mm_kernel_device_get_physdev_subsystem (port); if ((self->priv->enabled_rules & MM_FILTER_RULE_TTY_PLATFORM_DRIVER) && - (!g_strcmp0 (physdev_subsystem, "platform") || !g_strcmp0 (physdev_subsystem, "pnp")) && - (!mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_PLATFORM_DRIVER_PROBE"))) { - mm_dbg ("[filter] (%s/%s): port filtered: port's parent platform driver is not whitelisted", subsystem, name); - return FALSE; + (!g_strcmp0 (physdev_subsystem, "platform") || !g_strcmp0 (physdev_subsystem, "pnp"))) { + if (!mm_kernel_device_get_global_property_as_boolean (port, "ID_MM_PLATFORM_DRIVER_PROBE")) { + mm_dbg ("[filter] (%s/%s): port filtered: port's parent platform driver is not whitelisted", subsystem, name); + return FALSE; + } + mm_dbg ("[filter] (%s/%s): port allowed: port's parent platform driver is whitelisted", subsystem, name); + return TRUE; } /* Otherwise, TTY probed */ |