
From: "Randy.Dunlap" <rddunlap@osdl.org>, Leann Ogasawara <ogasawara@osdl.org>

Fixes incorrect if statement.  Inserts pci_free_consistent on error.  



 25-akpm/drivers/scsi/qla1280.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/qla1280.c~qla1280-pci-alloc-free-checking drivers/scsi/qla1280.c
--- 25/drivers/scsi/qla1280.c~qla1280-pci-alloc-free-checking	Thu Sep  4 11:26:25 2003
+++ 25-akpm/drivers/scsi/qla1280.c	Thu Sep  4 11:26:25 2003
@@ -2008,15 +2008,22 @@ qla1280_mem_alloc(struct scsi_qla_host *
 						 ((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;
 }

_
