uchcom: Fix panic when accessing a ucom device based on uchcom
authorJan Lentfer <Jan.Lentfer@web.de>
Mon, 11 Jan 2010 19:20:07 +0000 (20:20 +0100)
committerJan Lentfer <Jan.Lentfer@web.de>
Mon, 11 Jan 2010 19:20:07 +0000 (20:20 +0100)
The panic was due to uchcom_param arg being always NULL,
since ucom->sc_parent wasn't initialized properly.
All other usb serial drivers also seem to do it this way.

sys/dev/usbmisc/uchcom/uchcom.c

index 353552e..d925d9c 100644 (file)
@@ -276,6 +276,7 @@ uchcom_attach(device_t self)
        sc->sc_intr_size = endpoints.ep_intr_size;
 
        /* setup ucom layer */
+       ucom->sc_parent = sc;
        ucom->sc_portno = UCOM_UNK_PORTNO;
        ucom->sc_bulkin_no = endpoints.ep_bulkin;
        ucom->sc_bulkout_no = endpoints.ep_bulkout;