NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

re: kern/57149



The following reply was made to PR kern/57149; it has been noted by GNATS.

From: matthew green <mrg%eterna.com.au@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: kern-bug-people%netbsd.org@localhost, gnats-admin%netbsd.org@localhost,
    netbsd-bugs%netbsd.org@localhost, nervoso%k1.com.br@localhost
Subject: re: kern/57149
Date: Tue, 10 Jan 2023 06:14:58 +1100

 the ukbd detach bug looks obvious to me.  can you try this patch?
 
 
 .mrg.
 
 
 Index: dev/usb/ukbd.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/usb/ukbd.c,v
 retrieving revision 1.161
 diff -p -u -r1.161 ukbd.c
 --- dev/usb/ukbd.c	6 Apr 2022 21:51:29 -0000	1.161
 +++ dev/usb/ukbd.c	9 Jan 2023 19:13:29 -0000
 @@ -295,6 +295,7 @@ struct ukbd_softc {
  	uint16_t sc_pollchars[MAXKEYS];
  
  	u_char sc_dying;
 +	u_char sc_attached;
  };
  
  #ifdef UKBD_DEBUG
 @@ -520,6 +521,8 @@ ukbd_attach(device_t parent, device_t se
  
  	sc->sc_wskbddev = config_found(self, &a, wskbddevprint, CFARGS_NONE);
  
 +	sc->sc_attached = true;
 +
  	return;
  }
  
 @@ -584,6 +587,9 @@ ukbd_detach(device_t self, int flags)
  
  	pmf_device_deregister(self);
  
 +	if (!sc->sc_attached)
 +		return rv;
 +
  	if (sc->sc_console_keyboard) {
  		/*
  		 * Disconnect our consops and set ukbd_is_console
 


Home | Main Index | Thread Index | Old Index