提交 c8e9b30c 编写于 作者: V Vishnu Dasa 提交者: Greg Kroah-Hartman

VMCI: Release notification_bitmap in error path

notification_bitmap may not be released when VMCI_CAPS_DMA_DATAGRAM
capability is missing from the device.  Add missing
'err_free_notification_bitmap' label and use it instead of
'err_free_data_buffers' to avoid this.

Fixes: eed2298d ("VMCI: dma dg: detect DMA datagram capability")
Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: NBryan Tan <bryantan@vmware.com>
Reviewed-by: NRajesh Jalisatgi <rjalisatgi@vmware.com>
Signed-off-by: NVishnu Dasa <vdasa@vmware.com>
Link: https://lore.kernel.org/r/20220318060040.31621-1-vdasa@vmware.comSigned-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 5df0e734
......@@ -720,7 +720,7 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
dev_err(&pdev->dev,
"Missing capability: VMCI_CAPS_DMA_DATAGRAM\n");
error = -ENXIO;
goto err_free_data_buffers;
goto err_free_notification_bitmap;
}
}
......@@ -886,6 +886,7 @@ static int vmci_guest_probe_device(struct pci_dev *pdev,
vmci_dev_g = NULL;
spin_unlock_irq(&vmci_dev_spinlock);
err_free_notification_bitmap:
if (vmci_dev->notification_bitmap) {
vmci_write_reg(vmci_dev, VMCI_CONTROL_RESET, VMCI_CONTROL_ADDR);
dma_free_coherent(&pdev->dev, PAGE_SIZE,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册