]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] janitor: qla1280 pci alloc/free consistent checking
authorRandy Dunlap <rddunlap@osdl.org>
Sat, 6 Sep 2003 07:36:57 +0000 (00:36 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Sat, 6 Sep 2003 07:36:57 +0000 (00:36 -0700)
Ports previous qla1280.c patch to 2.6.0-test2.  Fixes incorrect if
statement.  Inserts pci_free_consistent on error.

From: Leann Ogasawara <ogasawara@osdl.org>

drivers/scsi/qla1280.c

index 5de0a6329d8a5c88f7d7b4ca5b95a5326324e23b..0e7b710bb90e92869966e5599aa3f5fb4c3fa547 100644 (file)
@@ -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;
 }