From aa1ff7b9f49e26570b2c9de255b3d02b8c8ee783 Mon Sep 17 00:00:00 2001 From: mpi Date: Thu, 16 Apr 2015 14:23:48 +0000 Subject: [PATCH] Make sure LLVM static analyzer do not report a false positive, found by and fix confirmed by jsg@. --- sys/dev/usb/ehci.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index 63e10004158..b21bb200b79 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ehci.c,v 1.184 2015/04/10 15:33:20 mpi Exp $ */ +/* $OpenBSD: ehci.c,v 1.185 2015/04/16 14:23:48 mpi Exp $ */ /* $NetBSD: ehci.c,v 1.66 2004/06/30 03:11:56 mycroft Exp $ */ /* @@ -3392,7 +3392,7 @@ ehci_alloc_itd_chain(struct ehci_softc *sc, struct usbd_xfer *xfer) struct ehci_xfer *ex = (struct ehci_xfer *)xfer; usb_endpoint_descriptor_t *ed = xfer->pipe->endpoint->edesc; const uint32_t mps = UGETW(ed->wMaxPacketSize); - struct ehci_soft_itd *itd, *pitd = NULL; + struct ehci_soft_itd *itd = NULL, *pitd = NULL; int i, j, nframes, uframes, ufrperframe; int offs = 0, trans_count = 0; @@ -3505,7 +3505,6 @@ ehci_alloc_itd_chain(struct ehci_softc *sc, struct usbd_xfer *xfer) pitd = itd; } - itd->xfer_next = NULL; ex->itdend = itd; return (0); @@ -3517,7 +3516,7 @@ ehci_alloc_sitd_chain(struct ehci_softc *sc, struct usbd_xfer *xfer) struct ehci_xfer *ex = (struct ehci_xfer *)xfer; struct usbd_device *hshub = xfer->device->myhsport->parent; usb_endpoint_descriptor_t *ed = xfer->pipe->endpoint->edesc; - struct ehci_soft_itd *itd, *pitd = NULL; + struct ehci_soft_itd *itd = NULL, *pitd = NULL; uint8_t smask, cmask, tp, uf; int i, nframes, offs = 0; uint32_t endp; @@ -3588,7 +3587,6 @@ ehci_alloc_sitd_chain(struct ehci_softc *sc, struct usbd_xfer *xfer) pitd = itd; } - itd->xfer_next = NULL; ex->itdend = itd; return (0); -- 2.20.1