kernel: Add some more missing crit_exit(), rel_mplock(), etc.
authorSascha Wildner <saw@online.de>
Tue, 10 Jun 2014 09:58:22 +0000 (11:58 +0200)
committerSascha Wildner <saw@online.de>
Tue, 10 Jun 2014 09:58:41 +0000 (11:58 +0200)
sys/bus/firewire/firewire.c
sys/dev/raid/aac/aac.c
sys/dev/raid/dpt/dpt_pci.c
sys/emulation/linux/linux_stats.c

index 81139fa..02204fa 100644 (file)
@@ -1884,6 +1884,7 @@ fw_rcv(struct fw_rcv_buf *rb)
                        rb->xfer = STAILQ_FIRST(&bind->xferlist);
                        if (rb->xfer == NULL) {
                                kprintf("Discard packet for this bind\n");
+                               crit_exit();
                                goto err;
                        }
                        STAILQ_REMOVE_HEAD(&bind->xferlist, link);
index cc47779..2997d33 100644 (file)
@@ -2953,16 +2953,17 @@ aac_filter_read(struct knote *kn, long hint)
 {
        struct aac_softc *sc;
        struct aac_fib_context *ctx;
+       int ret = 0;
 
        sc = (struct aac_softc *)kn->kn_hook;
 
        lockmgr(&sc->aac_aifq_lock, LK_EXCLUSIVE);
        for (ctx = sc->fibctx; ctx; ctx = ctx->next)
                if (ctx->ctx_idx != sc->aifq_idx || ctx->ctx_wrap)
-                       return(1);
+                       ret = 1;
        lockmgr(&sc->aac_aifq_lock, LK_RELEASE);
 
-       return (0);
+       return(ret);
 }
 
 static void
index f0bc443..0c46373 100644 (file)
@@ -153,6 +153,7 @@ dpt_pci_attach (device_t dev)
        if (dpt_init(dpt) != 0) {
                dpt_free(dpt);
                error = ENXIO;
+               crit_exit();
                goto bad;
        }
 
index 3794e0b..f6ae2f5 100644 (file)
@@ -311,10 +311,14 @@ sys_linux_fstatfs(struct linux_fstatfs_args *args)
                kprintf(ARGS(fstatfs, "%d, *"), args->fd);
 #endif
        get_mplock();
-       if ((error = kern_fstatfs(args->fd, &statfs)) != 0)
+       if ((error = kern_fstatfs(args->fd, &statfs)) != 0) {
+               rel_mplock();
                return (error);
-       if ((error = holdvnode(p->p_fd, args->fd, &fp)) != 0)
+       }
+       if ((error = holdvnode(p->p_fd, args->fd, &fp)) != 0) {
+               rel_mplock();
                return (error);
+       }
        error = vn_get_namelen((struct vnode *)fp->f_data, &namelen);
        rel_mplock();
        fdrop(fp);