kernel: fix a crash with failing to open char devices
authorAlan Cox <alan@linux.intel.com>
Wed, 4 Jul 2018 00:50:00 +0000 (01:50 +0100)
committerAlan Cox <alan@linux.intel.com>
Wed, 4 Jul 2018 00:50:00 +0000 (01:50 +0100)
Kernel/syscall_fs3.c

index cdfa5c6..d628b9d 100644 (file)
@@ -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 */