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:
dec4927
)
tests: fix a segfault in error path
author
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Tue, 30 Jul 2019 11:49:49 +0000
(13:49 +0200)
committer
Bartosz Golaszewski
<bgolaszewski@baylibre.com>
Tue, 30 Jul 2019 11:49:49 +0000
(13:49 +0200)
We may all the atexit() cleanup func before the gpio_mockup context
is setup. This will result in a segfault so add an appropriate check.
Fixes: b8659e044d50 ("tests: use libgpiomockup")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
tests/gpiod-test.c
patch
|
blob
|
history
diff --git
a/tests/gpiod-test.c
b/tests/gpiod-test.c
index 82e23ea11dc63a83f693edb024cf78f186ff6e42..f75173c7ff0192261eceed068d10e9bde02c4b4d 100644
(file)
--- a/
tests/gpiod-test.c
+++ b/
tests/gpiod-test.c
@@
-314,7
+314,8
@@
static void cleanup_func(void)
if (globals.toolpath)
free(globals.toolpath);
- gpio_mockup_unref(globals.mockup);
+ if (globals.mockup)
+ gpio_mockup_unref(globals.mockup);
}
static void event_lock(void)