Fix memory leak of devinfop
PR: 108719 Submitted by: Antoine Brodin
This commit is contained in:
parent
f254d5b0d1
commit
5f1413947b
@ -277,10 +277,8 @@ USB_ATTACH(uvisor)
|
|||||||
|
|
||||||
devinfo = malloc(1024, M_USBDEV, M_WAITOK);
|
devinfo = malloc(1024, M_USBDEV, M_WAITOK);
|
||||||
ucom = &sc->sc_ucom;
|
ucom = &sc->sc_ucom;
|
||||||
|
|
||||||
bzero(sc, sizeof (struct uvisor_softc));
|
bzero(sc, sizeof (struct uvisor_softc));
|
||||||
usbd_devinfo(dev, 0, devinfo);
|
usbd_devinfo(dev, 0, devinfo);
|
||||||
|
|
||||||
ucom->sc_dev = self;
|
ucom->sc_dev = self;
|
||||||
device_set_desc_copy(self, devinfo);
|
device_set_desc_copy(self, devinfo);
|
||||||
|
|
||||||
@ -289,6 +287,7 @@ USB_ATTACH(uvisor)
|
|||||||
|
|
||||||
devname = device_get_nameunit(ucom->sc_dev);
|
devname = device_get_nameunit(ucom->sc_dev);
|
||||||
printf("%s: %s\n", devname, devinfo);
|
printf("%s: %s\n", devname, devinfo);
|
||||||
|
free(devinfo, M_USBDEV);
|
||||||
|
|
||||||
DPRINTFN(10,("\nuvisor_attach: sc=%p\n", sc));
|
DPRINTFN(10,("\nuvisor_attach: sc=%p\n", sc));
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user