mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-31 12:52:29 -04:00
scsi: ibmvfc: allocate and free NVMe channel group discover buffer
Allocate a discovery buffer for the NVMe channel group and free it on all teardown and error paths. The existing discovery-buffer allocation only covered the SCSI channel group. This patch is prepratory for sending NVMe/FC target discovery MAD. Signed-off-by: Tyrel Datwyler <tyreld@linux.ibm.com> Link: https://patch.msgid.link/20260723000149.969416-15-tyreld@linux.ibm.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
committed by
Martin K. Petersen
parent
8acacfa8b0
commit
fe150862d5
@@ -6375,6 +6375,7 @@ static void ibmvfc_free_mem(struct ibmvfc_host *vhost)
|
||||
mempool_destroy(vhost->tgt_pool);
|
||||
kfree(vhost->trace);
|
||||
ibmvfc_free_disc_buf(vhost->dev, &vhost->scsi_scrqs);
|
||||
ibmvfc_free_disc_buf(vhost->dev, &vhost->nvme_scrqs);
|
||||
dma_free_coherent(vhost->dev, sizeof(*vhost->login_buf),
|
||||
vhost->login_buf, vhost->login_buf_dma);
|
||||
dma_free_coherent(vhost->dev, sizeof(*vhost->channel_setup_buf),
|
||||
@@ -6437,12 +6438,15 @@ static int ibmvfc_alloc_mem(struct ibmvfc_host *vhost)
|
||||
if (ibmvfc_alloc_disc_buf(dev, &vhost->scsi_scrqs))
|
||||
goto free_login_buffer;
|
||||
|
||||
if (ibmvfc_alloc_disc_buf(dev, &vhost->nvme_scrqs))
|
||||
goto free_scsi_disc_buffer;
|
||||
|
||||
vhost->trace = kzalloc_objs(struct ibmvfc_trace_entry,
|
||||
IBMVFC_NUM_TRACE_ENTRIES);
|
||||
atomic_set(&vhost->trace_index, -1);
|
||||
|
||||
if (!vhost->trace)
|
||||
goto free_scsi_disc_buffer;
|
||||
goto free_nvme_disc_buffer;
|
||||
|
||||
vhost->tgt_pool = mempool_create_kmalloc_pool(IBMVFC_TGT_MEMPOOL_SZ,
|
||||
sizeof(struct ibmvfc_target));
|
||||
@@ -6468,6 +6472,8 @@ static int ibmvfc_alloc_mem(struct ibmvfc_host *vhost)
|
||||
mempool_destroy(vhost->tgt_pool);
|
||||
free_trace:
|
||||
kfree(vhost->trace);
|
||||
free_nvme_disc_buffer:
|
||||
ibmvfc_free_disc_buf(dev, &vhost->nvme_scrqs);
|
||||
free_scsi_disc_buffer:
|
||||
ibmvfc_free_disc_buf(dev, &vhost->scsi_scrqs);
|
||||
free_login_buffer:
|
||||
|
||||
Reference in New Issue
Block a user