hw/pvrdma: Some cosmetic fixes
PATCH 1/1 hw/pvrdma: Some cosmetic fixes
Signed-off-by Yuval Shaia <[email protected]>
--- hw/rdma/vmw/pvrdma_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
hw/rdma/vmw/pvrdma_main.c +5 -4
@@ -159,13 +159,13 @@ static void free_dsr(PVRDMADev *dev)free_dev_ring (pci_dev, &dev->dsr_info.cq, dev->dsr_info.cq_ring_state);rdma_pci_dma_unmap (pci_dev, dev->dsr_info.req, -sizeof (union pvrdma_cmd_req )); +sizeof (union pvrdma_cmd_req ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.rsp, -sizeof (union pvrdma_cmd_resp )); +sizeof (union pvrdma_cmd_resp ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.dsr, -sizeof (struct pvrdma_device_shared_region )); +sizeof (struct pvrdma_device_shared_region )); dev->dsr_info.dsr =NULL ; }
@@ -249,7 +249,8 @@ static void init_dsr_dev_caps(PVRDMADev *dev) {struct pvrdma_device_shared_region *dsr; -if (dev->dsr_info.dsr ==NULL ) { +if (!dev->dsr_info.dsr) { +/* Buggy or malicious guest driver */ rdma_error_report ("Can't initialized DSR" );return ; }
Signature · 1 line
2.20.1
Quoted 38 lines · Yuval Shaia
Signed-off-by Yuval Shaia <[email protected]>--- hw/rdma/vmw/pvrdma_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)hw/rdma/vmw/pvrdma_main.c +5
-5@@ -159,13 +159,13 @@ static void free_dsr(PVRDMADev *dev)free_dev_ring (pci_dev, &dev->dsr_info.cq, dev->dsr_info.cq_ring_state);rdma_pci_dma_unmap (pci_dev, dev->dsr_info.req, -sizeof (union pvrdma_cmd_req )); +sizeof (union pvrdma_cmd_req ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.rsp, -sizeof (union pvrdma_cmd_resp )); +sizeof (union pvrdma_cmd_resp ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.dsr, -sizeof (struct pvrdma_device_shared_region )); +sizeof (struct pvrdma_device_shared_region )); dev->dsr_info.dsr =NULL ; }@@ -249,7 +249,8 @@ static void init_dsr_dev_caps(PVRDMADev *dev) {struct pvrdma_device_shared_region *dsr; -if (dev->dsr_info.dsr ==NULL ) { +if (!dev->dsr_info.dsr) { +/* Buggy or malicious guest driver */ rdma_error_report ("Can't initialized DSR" );return ; } --
Quoted 2 lines
2.20.1
cc QEMU Trivial <[email protected]>
Reviewed-by Marcel Apfelbaum <[email protected]>
Thanks,
Marcel
Laurent Vivier
AppliedLe 05/04/2022 à 12:25, Marcel Apfelbaum a écrit :
Quoted 44 lines · Yuval Shaia
Quoted 38 lines
Signed-off-by Yuval Shaia <[email protected]>--- hw/rdma/vmw/pvrdma_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)hw/rdma/vmw/pvrdma_main.c +5
-5@@ -159,13 +159,13 @@ static void free_dsr(PVRDMADev *dev)free_dev_ring (pci_dev, &dev->dsr_info.cq, dev->dsr_info.cq_ring_state);rdma_pci_dma_unmap (pci_dev, dev->dsr_info.req, -sizeof (union pvrdma_cmd_req )); +sizeof (union pvrdma_cmd_req ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.rsp, -sizeof (union pvrdma_cmd_resp )); +sizeof (union pvrdma_cmd_resp ));rdma_pci_dma_unmap (pci_dev, dev->dsr_info.dsr, -sizeof (struct pvrdma_device_shared_region )); +sizeof (struct pvrdma_device_shared_region )); dev->dsr_info.dsr =NULL ; }@@ -249,7 +249,8 @@ static void init_dsr_dev_caps(PVRDMADev *dev) {struct pvrdma_device_shared_region *dsr; -if (dev->dsr_info.dsr ==NULL ) { +if (!dev->dsr_info.dsr) { +/* Buggy or malicious guest driver */ rdma_error_report ("Can't initialized DSR" );return ; } --Quoted 2 lines
2.20.1
cc QEMU Trivial <[email protected]>
Quoted 1 line
Reviewed-by Marcel Apfelbaum <[email protected]>
Applied to my trivial-patches branch.
Thanks,
Laurent