Don't let hacksync() call bus_dmamap_sync(9) on DMA maps which
are not initialized. This fixes a panic on sparc64 where calling bus_dmamap_sync(9) on NULL DMA maps is fatal. Approved by: sam
This commit is contained in:
parent
7c0cc5f941
commit
a893539e95
@ -661,9 +661,13 @@ ehci_pcd_enable(void *v_sc)
|
||||
static __inline void
|
||||
hacksync(usbd_xfer_handle xfer)
|
||||
{
|
||||
usbd_pipe_handle pipe = xfer->pipe;
|
||||
bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag;
|
||||
struct usb_dma_mapping *dmap = &xfer->dmamap;
|
||||
bus_dma_tag_t tag;
|
||||
struct usb_dma_mapping *dmap;
|
||||
|
||||
if (xfer->length == 0)
|
||||
return;
|
||||
tag = xfer->pipe->device->bus->buffer_dmatag;
|
||||
dmap = &xfer->dmamap;
|
||||
bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_PREWRITE);
|
||||
}
|
||||
|
||||
|
@ -1568,9 +1568,13 @@ ohci_device_bulk_done(usbd_xfer_handle xfer)
|
||||
static __inline void
|
||||
hacksync(usbd_xfer_handle xfer)
|
||||
{
|
||||
usbd_pipe_handle pipe = xfer->pipe;
|
||||
bus_dma_tag_t tag = pipe->device->bus->buffer_dmatag;
|
||||
struct usb_dma_mapping *dmap = &xfer->dmamap;
|
||||
bus_dma_tag_t tag;
|
||||
struct usb_dma_mapping *dmap;
|
||||
|
||||
if (xfer->length == 0)
|
||||
return;
|
||||
tag = xfer->pipe->device->bus->buffer_dmatag;
|
||||
dmap = &xfer->dmamap;
|
||||
bus_dmamap_sync(tag, dmap->map, BUS_DMASYNC_PREWRITE);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user