projects
/
qemu-gpiodev
/
libgpiod.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c1c11a3
)
core: move a call to memset() in gpiod_line_event_wait_bulk()
author
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 9 Jan 2017 15:23:05 +0000
(16:23 +0100)
committer
Bartosz Golaszewski
<bartekgola@gmail.com>
Mon, 9 Jan 2017 15:23:05 +0000
(16:23 +0100)
Check for error conditions first.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
core.c
patch
|
blob
|
history
diff --git
a/core.c
b/core.c
index 006e18bef204e29fb4ddbff6a9bdd01a2c63278f..0d36bdddc79afd03f14d82278841e57302ab81c9 100644
(file)
--- 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];