summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
Diffstat (limited to 'apps')
-rw-r--r--apps/examples/adc/adc_main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/examples/adc/adc_main.c b/apps/examples/adc/adc_main.c
index 404fba8c1..553658fee 100644
--- a/apps/examples/adc/adc_main.c
+++ b/apps/examples/adc/adc_main.c
@@ -289,7 +289,7 @@ int adc_main(int argc, char *argv[])
{
message("adc_main: open %s failed: %d\n", g_adcstate.devpath, errno);
errval = 2;
- goto errout_with_dev;
+ goto errout;
}
/* Now loop the appropriate number of times, displaying the collected
@@ -357,6 +357,11 @@ int adc_main(int argc, char *argv[])
}
}
+ close(fd);
+ return OK;
+
+ /* Error exits */
+
errout_with_dev:
close(fd);