mirror of
https://github.com/opnsense/src.git
synced 2026-06-08 16:22:46 -04:00
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
2 changed files with 14 additions and 6 deletions
|
|
@ -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 a new issue