If we have a bulk object containing only a single line passed to
verify_line_bulk(), we end up not checking if the line was previously
requested.
Fix it by starting the iteration at offset 0 instead of 1 and skipping
the line owner check for i == 0.
Signed-off-by: Bartosz Golaszewski <bartekgola@gmail.com>
chip = gpiod_line_get_chip(bulk->lines[0]);
- for (i = 1; i < bulk->num_lines; i++) {
+ for (i = 0; i < bulk->num_lines; i++) {
line = bulk->lines[i];
- if (chip != gpiod_line_get_chip(line)) {
+ if (i > 0 && chip != gpiod_line_get_chip(line)) {
set_last_error(GPIOD_EBULKINCOH);
return false;
}