From: Alan Cox Date: Wed, 4 Jul 2018 00:50:00 +0000 (+0100) Subject: kernel: fix a crash with failing to open char devices X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=fc621a14e8c60e50f3406a49395571d1d5266bb9;p=FUZIX.git kernel: fix a crash with failing to open char devices --- diff --git a/Kernel/syscall_fs3.c b/Kernel/syscall_fs3.c index cdfa5c64..d628b9d9 100644 --- a/Kernel/syscall_fs3.c +++ b/Kernel/syscall_fs3.c @@ -102,10 +102,8 @@ arg_t _open(void) by the call to dev_openi */ i_unlock(*iptr); - if (dev_openi(iptr, flag) != 0) { - i_deref(*iptr); + if (dev_openi(iptr, flag) != 0) goto cantopen; - } /* May have changed */ /* get the static pointer back in case it changed via dev usage or just because we blocked */