Fix panics in two syscalls, caps_sys_get(2) and caps_sys_wait(2).
authorSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 08:43:08 +0000 (10:43 +0200)
committerSascha Wildner <saw@online.de>
Sun, 8 Aug 2010 08:44:04 +0000 (10:44 +0200)
Only call caps_drop() if caps != NULL.

sys/kern/lwkt_caps.c

index d713224..cc93214 100644 (file)
@@ -886,10 +886,10 @@ sys_caps_sys_get(struct caps_sys_get_args *uap)
        } else {
            error = caps_process_msg(caps, msg, uap);
        }
+       caps_drop(caps);
     } else {
        error = EINVAL;
     }
-    caps_drop(caps);
     rel_mplock();
     return(error);
 }
@@ -936,10 +936,10 @@ sys_caps_sys_wait(struct caps_sys_wait_args *uap)
                                    (struct caps_sys_get_args *)uap);
            }
        }
+       caps_drop(caps);
     } else {
        error = EINVAL;
     }
-    caps_drop(caps);
     rel_mplock();
     return(error);
 }