diff options
-rw-r--r-- | liblazy/liblazy_hal.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/liblazy/liblazy_hal.c b/liblazy/liblazy_hal.c index 4b7dd43..a80d7e4 100644 --- a/liblazy/liblazy_hal.c +++ b/liblazy/liblazy_hal.c @@ -235,16 +235,17 @@ int liblazy_hal_query_capability(char *udi, char *capability) return LIBLAZY_ERROR_INVALID_ARGUMENT; error = liblazy_hal_get_property_strlist(udi, "info.capabilities", &caps); - if (caps != NULL && !error) { + if (error) + return error; + + if (caps != NULL) { for (i = 0; caps[i] != NULL; i++) { - if (strcmp(caps[i], capability) == 0) { + if (strcmp(caps[i], capability) == 0) error = 1; - break; - } } liblazy_free_strlist(caps); - error = 0; } + return error; } |