scsi: qla4xxx: Use dma_pool_zalloc()
[linux-2.6-microblaze.git] / drivers / scsi / qla4xxx / ql4_mbx.c
index bda2e64..5d56904 100644 (file)
@@ -1584,12 +1584,11 @@ int qla4xxx_get_chap(struct scsi_qla_host *ha, char *username, char *password,
        struct ql4_chap_table *chap_table;
        dma_addr_t chap_dma;
 
-       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
+       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
        if (chap_table == NULL)
                return -ENOMEM;
 
        chap_size = sizeof(struct ql4_chap_table);
-       memset(chap_table, 0, chap_size);
 
        if (is_qla40XX(ha))
                offset = FLASH_CHAP_OFFSET | (idx * chap_size);
@@ -1648,13 +1647,12 @@ int qla4xxx_set_chap(struct scsi_qla_host *ha, char *username, char *password,
        uint32_t chap_size = 0;
        dma_addr_t chap_dma;
 
-       chap_table = dma_pool_alloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
+       chap_table = dma_pool_zalloc(ha->chap_dma_pool, GFP_KERNEL, &chap_dma);
        if (chap_table == NULL) {
                ret =  -ENOMEM;
                goto exit_set_chap;
        }
 
-       memset(chap_table, 0, sizeof(struct ql4_chap_table));
        if (bidi)
                chap_table->flags |= BIT_6; /* peer */
        else