summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/dev/usb/uhid.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/usb/uhid.c b/sys/dev/usb/uhid.c
index 4095ee9..1c4684f 100644
--- a/sys/dev/usb/uhid.c
+++ b/sys/dev/usb/uhid.c
@@ -425,6 +425,8 @@ uhidopen(dev_t dev, int flag, int mode, usb_proc_ptr p)
"error=%d\n",err));
free(sc->sc_ibuf, M_USBDEV);
free(sc->sc_obuf, M_USBDEV);
+ sc->sc_ibuf = sc->sc_obuf = NULL;
+
sc->sc_state &= ~UHID_OPEN;
return (EIO);
}
@@ -455,6 +457,7 @@ uhidclose(dev_t dev, int flag, int mode, usb_proc_ptr p)
free(sc->sc_ibuf, M_USBDEV);
free(sc->sc_obuf, M_USBDEV);
+ sc->sc_ibuf = sc->sc_obuf = NULL;
sc->sc_state &= ~UHID_OPEN;
OpenPOWER on IntegriCloud