From 2892b218eb7573dc71aef2dceef1dcd1e4ff3d17 Mon Sep 17 00:00:00 2001 From: jsg Date: Sun, 3 Aug 2014 14:30:28 +0000 Subject: [PATCH] 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@ --- sys/dev/usb/ehci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.20.1