From 7c4c5368aeb8dde4d53dfd5055e40cc0b42a0899 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Sat, 24 Dec 2022 12:45:41 +0300 Subject: [PATCH] hidraw(4): Replace Giant with bus_topo_lock --- sys/dev/hid/hidraw.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/sys/dev/hid/hidraw.c b/sys/dev/hid/hidraw.c index 8964e31f7bb..4ea39dda383 100644 --- a/sys/dev/hid/hidraw.c +++ b/sys/dev/hid/hidraw.c @@ -679,10 +679,9 @@ hidraw_ioctl(struct cdev *dev, u_long cmd, caddr_t addr, int flag, buf = HIDRAW_LOCAL_ALLOC(local_buf, hgd->hgd_maxlen); copyin(hgd->hgd_data, buf, hgd->hgd_maxlen); - /* Lock newbus around set_report_descr call */ - mtx_lock(&Giant); + bus_topo_lock(); error = hid_set_report_descr(sc->sc_dev, buf, hgd->hgd_maxlen); - mtx_unlock(&Giant); + bus_topo_unlock(); HIDRAW_LOCAL_FREE(local_buf, buf); /* Realloc hidraw input queue */