tests: fix a potential segfault
authorBartosz Golaszewski <bartekgola@gmail.com>
Thu, 23 Feb 2017 10:47:57 +0000 (11:47 +0100)
committerBartosz Golaszewski <bartekgola@gmail.com>
Thu, 23 Feb 2017 10:47:57 +0000 (11:47 +0100)
commita29f20ae8a9f45ad55c4aa64bd4f2a415608609f
tree19e2567db71e5c04cbd6b60364cc1b2f007ae705
parent31af92a9aa800beff4dee1ba35e871feff04fad3
tests: fix a potential segfault

We should only sort the mockup chip pointers after determining that
all gpiochip device files have actually been created. Otherwise we
might sort invalid memory since we don't create the mockup_chip
structures for nonexistent devices.

Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
tests/unit/gpiod-unit.c