From bbfec32d156cec4c004f6f5148a074ba5f0a294d Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Wed, 6 Apr 2022 16:45:28 -0700 Subject: [PATCH] isci: Propagate error from bus_dma_tag_create. Return error from isci_controller_allocate_memory if bus_dma_tag_create fails instead of ignoring the error. --- sys/dev/isci/isci_controller.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/dev/isci/isci_controller.c b/sys/dev/isci/isci_controller.c index 9848f1bc8302..0c4773193e45 100644 --- a/sys/dev/isci/isci_controller.c +++ b/sys/dev/isci/isci_controller.c @@ -412,7 +412,6 @@ int isci_controller_allocate_memory(struct ISCI_CONTROLLER *controller) int error; device_t device = controller->isci->device; uint32_t max_segment_size = isci_io_request_get_max_io_size(); - uint32_t status = 0; struct ISCI_MEMORY *uncached_controller_memory = &controller->uncached_controller_memory; struct ISCI_MEMORY *cached_controller_memory = @@ -477,13 +476,16 @@ int isci_controller_allocate_memory(struct ISCI_CONTROLLER *controller) * will enable better performance than creating the DMA maps every time we get * an I/O. */ - status = bus_dma_tag_create(bus_get_dma_tag(device), 0x1, + error = bus_dma_tag_create(bus_get_dma_tag(device), 0x1, ISCI_DMA_BOUNDARY, BUS_SPACE_MAXADDR, BUS_SPACE_MAXADDR, NULL, NULL, isci_io_request_get_max_io_size(), SCI_MAX_SCATTER_GATHER_ELEMENTS, max_segment_size, 0, busdma_lock_mutex, &controller->lock, &controller->buffer_dma_tag); + if (error != 0) + return (error); + sci_pool_initialize(controller->request_pool); virtual_address = request_memory->virtual_address;