Add missing device_unref() calls to vldcpkqfilter().

The knote that vldcpkqfilter() sets up does not take a device reference.

OK?

Index: arch/sparc64/dev/vldcp.c
===================================================================
RCS file: src/sys/arch/sparc64/dev/vldcp.c,v
retrieving revision 1.23
diff -u -p -r1.23 vldcp.c
--- arch/sparc64/dev/vldcp.c    2 Jul 2022 08:50:41 -0000       1.23
+++ arch/sparc64/dev/vldcp.c    9 Jul 2022 13:39:10 -0000
@@ -683,6 +685,7 @@ vldcpkqfilter(dev_t dev, struct knote *k
                break;
 
        default:
+               device_unref(&sc->sc_dv);
                return (EINVAL);
        }
 
@@ -692,5 +695,6 @@ vldcpkqfilter(dev_t dev, struct knote *k
        klist_insert_locked(klist, kn);
        splx(s);
 
+       device_unref(&sc->sc_dv);
        return (0);
 }

Reply via email to