--- zzzz-none-000/linux-3.10.107/drivers/usb/core/buffer.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/usb/core/buffer.c 2021-02-04 17:41:59.000000000 +0000 @@ -2,7 +2,7 @@ * DMA memory management for framework level HCD code (hc_driver) * * This implementation plugs in through generic "usb_bus" level methods, - * and should work with all USB controllers, regardles of bus type. + * and should work with all USB controllers, regardless of bus type. */ #include @@ -51,10 +51,11 @@ * * Call this as part of initializing a host controller that uses the dma * memory allocators. It initializes some pools of dma-coherent memory that - * will be shared by all drivers using that controller, or returns a negative - * errno value on error. + * will be shared by all drivers using that controller. * * Call hcd_buffer_destroy() to clean up after using those pools. + * + * Return: 0 if successful. A negative errno value otherwise. */ int hcd_buffer_create(struct usb_hcd *hcd) { @@ -69,7 +70,7 @@ size = pool_max[i]; if (!size) continue; - snprintf(name, sizeof name, "buffer-%d", size); + snprintf(name, sizeof(name), "buffer-%d", size); hcd->pool[i] = dma_pool_create(name, hcd->self.controller, size, size, 0); if (!hcd->pool[i]) { @@ -94,6 +95,7 @@ for (i = 0; i < HCD_BUFFER_POOLS; i++) { struct dma_pool *pool = hcd->pool[i]; + if (pool) { dma_pool_destroy(pool); hcd->pool[i] = NULL;