diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-29 12:53:34 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-04-29 12:53:34 +0000 |
commit | 857812582ef36083c94121018a034c88bdda3ef3 (patch) | |
tree | 531ebb90e0a8d16ffa8bbafc3f629938b3d048bf /sys/dev | |
parent | 0fa030b5e0cc0ac80c9c2bc844598c870f75b56b (diff) |
Make sure to call uhidev_close() upon detach, plug another xfer leak.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/usb/ugold.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/dev/usb/ugold.c b/sys/dev/usb/ugold.c index 3679424bf66..56d1d36cf92 100644 --- a/sys/dev/usb/ugold.c +++ b/sys/dev/usb/ugold.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ugold.c,v 1.5 2014/04/15 09:14:27 mpi Exp $ */ +/* $OpenBSD: ugold.c,v 1.6 2014/04/29 12:53:33 mpi Exp $ */ /* * Copyright (c) 2013 Takayoshi SASANO <sasano@openbsd.org> @@ -183,6 +183,9 @@ ugold_detach(struct device *self, int flags) for (i = 0; i < sc->sc_num_sensors; i++) sensor_detach(&sc->sc_sensordev, &sc->sc_sensor[i]); + if (sc->sc_hdev.sc_state & UHIDEV_OPEN) + uhidev_close(&sc->sc_hdev); + return (0); } |