1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-31 16:57:10 +00:00

MFNetBSD:

revision 1.40
    date: 2000/10/10 12:37:01;  author: augustss;  state: Exp;  lines: +4 -3
    Don't free unallocated pointer in detach (can happen if detach happens
    before attach has finished).
This commit is contained in:
Josef Karthauser 2002-04-01 20:32:50 +00:00
parent 236c85a379
commit 9aee8efbeb
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=93588

View File

@ -1,4 +1,4 @@
/* $NetBSD: uhid.c,v 1.39 2000/06/01 14:29:00 augustss Exp $ */
/* $NetBSD: uhid.c,v 1.40 2000/10/10 12:37:01 augustss Exp $ */
/* $FreeBSD$ */
/*
@ -228,7 +228,7 @@ USB_ATTACH(uhid)
sc->sc_ep_addr = ed->bEndpointAddress;
desc = 0;
desc = NULL;
err = usbd_alloc_report_desc(uaa->iface, &desc, &size, M_USBDEV);
if (err) {
printf("%s: no report descriptor\n", USBDEVNAME(sc->sc_dev));
@ -321,7 +321,8 @@ USB_DETACH(uhid)
destroy_dev(sc->dev);
#endif
free(sc->sc_repdesc, M_USBDEV);
if (sc->sc_repdesc)
free(sc->sc_repdesc, M_USBDEV);
return (0);
}