From a8a9ab28bd73b5b0496f329677b4322a76dfabdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 1 Jan 2019 20:30:27 +0100 Subject: [PATCH] module/removables: log warning if action is something we didn't expect --- modules/removables.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/modules/removables.c b/modules/removables.c index ac89678..0bfe60c 100644 --- a/modules/removables.c +++ b/modules/removables.c @@ -350,7 +350,10 @@ handle_udev_event(struct module *mod, struct udev_device *dev) bool add = strcmp(action, "add") == 0; bool del = strcmp(action, "remove") == 0; - assert(add || del); + if (!add && !del) { + LOG_WARN("unhandled action: %s", action); + return false; + } const char *devtype = udev_device_get_property_value(dev, "DEVTYPE");