ibmvfc: free channel_setup_buf during device tear down
Subsystems (3)
Tyrel Datwyler
maintainerPATCH 1/1 ibmvfc: free channel_setup_buf during device tear down
The buffer for negotiating channel setup is DMA allocated at device probe time. However, the remove path fails to free this allocation which will prevent the hypervisor from releasing the virtual device in the case of a hotplug remove.
Fix this issue by freeing the buffer allocation in ibmvfc_free_mem().
--- drivers/scsi/ibmvscsi/ibmvfc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/ibmvscsi/ibmvfc.c +2 -0
@@ -5770,6 +5770,8 @@ static void ibmvfc_free_mem(struct ibmvfc_host *vhost) vhost->disc_buf_dma);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), + vhost->channel_setup_buf, vhost->channel_setup_dma);dma_pool_destroy (vhost->sg_pool);ibmvfc_free_queue (vhost, async_q);LEAVE ;
Signature · 1 line
2.27.0
Martin K. Petersen
AppliedQuoted 6 lines · Tyrel Datwyler
The buffer for negotiating channel setup is DMA allocated at device probe time. However, the remove path fails to free this allocation which will prevent the hypervisor from releasing the virtual device in the case of a hotplug remove.
Fix this issue by freeing the buffer allocation in
ibmvfc_free_mem().
Applied to 5.12/scsi-fixes, thanks!
[1/1] ibmvfc: free channel_setup_buf during device tear down
https://git.kernel.org/mkp/scsi/c/febb0cc847e7
Signature · 1 line
Martin K. Petersen Oracle Linux Engineering