From 6890e4ead995301e0e5de1df926825c5cee59323 Mon Sep 17 00:00:00 2001 From: Randy Dunlap Date: Sat, 6 Sep 2003 00:36:57 -0700 Subject: [PATCH] [PATCH] janitor: qla1280 pci alloc/free consistent checking Ports previous qla1280.c patch to 2.6.0-test2. Fixes incorrect if statement. Inserts pci_free_consistent on error. From: Leann Ogasawara --- drivers/scsi/qla1280.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/qla1280.c b/drivers/scsi/qla1280.c index 5de0a6329d8a..0e7b710bb90e 100644 --- a/drivers/scsi/qla1280.c +++ b/drivers/scsi/qla1280.c @@ -2008,15 +2008,22 @@ qla1280_mem_alloc(struct scsi_qla_host *ha) ((RESPONSE_ENTRY_CNT + 1) * (sizeof(struct response))), &dma_handle); - if (!ha->request_ring) + if (!ha->response_ring) goto error; ha->response_dma = dma_handle; status = 0; + goto finish; error: if (status) dprintk(2, "qla1280_mem_alloc: **** FAILED ****\n"); + if (ha->request_ring) + pci_free_consistent(ha->pdev, + ((REQUEST_ENTRY_CNT + 1) * + (sizeof(request_t))), + ha->request_ring, ha->request_dma); + finish: LEAVE("qla1280_mem_alloc"); return status; } -- 2.39.5