summaryrefslogtreecommitdiff
path: root/pony_spi.c
diff options
context:
space:
mode:
Diffstat (limited to 'pony_spi.c')
-rw-r--r--pony_spi.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/pony_spi.c b/pony_spi.c
index b5dfc2f..6ce467e 100644
--- a/pony_spi.c
+++ b/pony_spi.c
@@ -99,6 +99,10 @@ int pony_spi_init(void)
if (arg && strlen(arg)) {
sp_fd = sp_openserport( arg, 9600 );
+ if (sp_fd < 0) {
+ free(arg);
+ return 1;
+ }
have_device++;
}
free(arg);