core: ctxless: bail-out if num_lines == 0

Return -1 and set errno to EINVAL if the number of lines specified in
any context-less helper is 0. This is done in addition to bailing out
when the number is higher than the maximum supported number of GPIO
lines. This fixes the segfaults that currently ocurr for num_lines == 0.

Signed-off-by: Bartosz Golaszewski <>
1 file changed