sc->sc_ibuf should be malloc'ed after quirks applied, as

sc->sc_isize might have changed.

MFC after:   3 days
This commit is contained in:
Kai Wang 2008-08-18 17:13:23 +00:00
parent ed5b720b20
commit 5a288360c8
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=181844

View File

@ -362,12 +362,6 @@ ums_attach(device_t self)
hid_input, &sc->sc_loc_btn[i-1], 0);
sc->sc_isize = hid_report_size(desc, size, hid_input, &sc->sc_iid);
sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT);
if (!sc->sc_ibuf) {
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
free(sc->sc_loc_btn, M_USB);
return ENXIO;
}
/*
* The Microsoft Wireless Notebook Optical Mouse seems to be in worse
@ -410,6 +404,13 @@ ums_attach(device_t self)
sc->sc_loc_btn[2].pos = 2;
}
sc->sc_ibuf = malloc(sc->sc_isize, M_USB, M_NOWAIT);
if (!sc->sc_ibuf) {
printf("%s: no memory\n", device_get_nameunit(sc->sc_dev));
free(sc->sc_loc_btn, M_USB);
return ENXIO;
}
sc->sc_ep_addr = ed->bEndpointAddress;
sc->sc_disconnected = 0;
free(desc, M_TEMP);