From: jsg Date: Sun, 3 Aug 2014 14:30:28 +0000 (+0000) Subject: don't return unitialised memory on error in ehci_alloc_sqtd() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=2892b218eb7573dc71aef2dceef1dcd1e4ff3d17;p=openbsd don't return unitialised memory on error in ehci_alloc_sqtd() It seems mpi introduced a problem into ehci.c rev 1.162 two weeks ago. An error check that used to return NULL now jumps to the end of the function, but sqtd isn't initialised at that point. ok miod@ deraadt@ --- diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 9da65060f24..05c006cb0c1 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.162 2014/07/12 20:13:48 mpi Exp $ */ +/* $OpenBSD: ehci.c,v 1.163 2014/08/03 14:30:28 jsg Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -2363,7 +2363,7 @@ ehci_free_sqh(struct ehci_softc *sc, struct ehci_soft_qh *sqh) struct ehci_soft_qtd * ehci_alloc_sqtd(struct ehci_softc *sc) { - struct ehci_soft_qtd *sqtd; + struct ehci_soft_qtd *sqtd = NULL; usbd_status err; int i, offs; struct usb_dma dma;