From 92a603fcf56d90919900a2d003dc9517d6357232 Mon Sep 17 00:00:00 2001 From: Bartosz Golaszewski Date: Mon, 9 Jan 2017 16:23:05 +0100 Subject: [PATCH] core: move a call to memset() in gpiod_line_event_wait_bulk() Check for error conditions first. Signed-off-by: Bartosz Golaszewski --- core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core.c b/core.c index 006e18b..0d36bdd 100644 --- a/core.c +++ b/core.c @@ -659,13 +659,13 @@ int gpiod_line_event_wait_bulk(struct gpiod_line_bulk *bulk, unsigned int i; int status; - memset(fds, 0, sizeof(fds)); - if (!line_bulk_is_event_configured(bulk)) { set_last_error(GPIOD_EEVREQUEST); return -1; } + memset(fds, 0, sizeof(fds)); + for (i = 0; i < bulk->num_lines; i++) { line = bulk->lines[i]; -- 2.30.2