From 16b7b0235963f6fc1a9d12ff8688e9698f32f147 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Sun, 11 Dec 2016 03:59:43 -0500 Subject: [PATCH] Clean-up notification iterator creation function MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérémie Galarneau --- lib/plugin-system/iterator.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/plugin-system/iterator.c b/lib/plugin-system/iterator.c index 71393d12..b0b5d38b 100644 --- a/lib/plugin-system/iterator.c +++ b/lib/plugin-system/iterator.c @@ -53,10 +53,19 @@ BT_HIDDEN struct bt_notification_iterator *bt_notification_iterator_create( struct bt_component *component) { + enum bt_component_type type; struct bt_notification_iterator *iterator = NULL; - if (!component || - bt_component_get_type(component) != BT_COMPONENT_TYPE_SOURCE) { + if (!component) { + goto end; + } + + type = bt_component_get_type(component); + switch (type) { + case BT_COMPONENT_TYPE_SOURCE: + case BT_COMPONENT_TYPE_FILTER: + break; + default: goto end; } -- 2.34.1