We're currently not storing the number of chips in the gpio-mockup
context structure after probing the module. The value is left
initialized to 0. This leads to both a memory leak and to chip ordering
errors when running the tests at high CPU loads. This patch fixes both
issues.
Fixes: e43e46d4f79c ("tests: mockup: add a library for controlling the gpio-mockup module")
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
if (!ctx->chips)
goto err_remove_module;
+ ctx->num_chips = num_chips;
+
pfd.fd = udev_monitor_get_fd(monitor);
pfd.events = POLLIN | POLLPRI;