summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/um/os-Linux/sigio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/arch/um/os-Linux/sigio.c b/arch/um/os-Linux/sigio.c
index 75558080d0bf..f91fd16e9911 100644
--- a/arch/um/os-Linux/sigio.c
+++ b/arch/um/os-Linux/sigio.c
@@ -167,15 +167,17 @@ static void update_thread(void)
int add_sigio_fd(int fd)
{
struct pollfd *p;
- int err = 0, i, n;
+ int err, i, n;
sigio_lock();
for (i = 0; i < all_sigio_fds.used; i++) {
if (all_sigio_fds.poll[i].fd == fd)
break;
}
- if (i == all_sigio_fds.used)
+ if (i == all_sigio_fds.used) {
+ err = -ENOSPC;
goto out;
+ }
p = &all_sigio_fds.poll[i];