Skip to content

Commit a657aba

Browse files
finikorgfabiobaltieri
authored andcommitted
espi: Fix gpio_manage_callback() logic
espi_manage_callback() returns -EINVAL if it could not remove callback. However if the list is empty success is returned when trying to remove callback. Signed-off-by: Andrei Emeltchenko <[email protected]>
1 parent 005a4d8 commit a657aba

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/espi/espi_utils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ static inline int espi_manage_callback(sys_slist_t *callbacks,
3232
return -EINVAL;
3333
}
3434
}
35+
} else if (!set) {
36+
return -EINVAL;
3537
}
3638

3739
if (set) {

0 commit comments

Comments
 (0)