* [PATCH] hw/pvrdma: Some cosmetic fixes
@ 2022-04-03 9:58 Yuval Shaia
2022-04-05 10:25 ` Marcel Apfelbaum
0 siblings, 1 reply; 3+ messages in thread
From: Yuval Shaia @ 2022-04-03 9:58 UTC (permalink / raw)
To: qemu-devel, yuval.shaia.ml, marcel.apfelbaum
Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
---
hw/rdma/vmw/pvrdma_main.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
index 91206dbb8e..aae382af59 100644
--- a/hw/rdma/vmw/pvrdma_main.c
+++ b/hw/rdma/vmw/pvrdma_main.c
@@ -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;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/pvrdma: Some cosmetic fixes
2022-04-03 9:58 [PATCH] hw/pvrdma: Some cosmetic fixes Yuval Shaia
@ 2022-04-05 10:25 ` Marcel Apfelbaum
2022-04-26 10:26 ` Laurent Vivier
0 siblings, 1 reply; 3+ messages in thread
From: Marcel Apfelbaum @ 2022-04-05 10:25 UTC (permalink / raw)
To: Yuval Shaia, QEMU Trivial; +Cc: qemu devel list
On Sun, Apr 3, 2022 at 12:00 PM Yuval Shaia <yuval.shaia.ml@gmail.com> wrote:
>
> Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
> ---
> hw/rdma/vmw/pvrdma_main.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
> index 91206dbb8e..aae382af59 100644
> --- a/hw/rdma/vmw/pvrdma_main.c
> +++ b/hw/rdma/vmw/pvrdma_main.c
> @@ -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;
> }
> --
> 2.20.1
>
cc: QEMU Trivial <qemu-trivial@nongnu.org>
Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Thanks,
Marcel
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] hw/pvrdma: Some cosmetic fixes
2022-04-05 10:25 ` Marcel Apfelbaum
@ 2022-04-26 10:26 ` Laurent Vivier
0 siblings, 0 replies; 3+ messages in thread
From: Laurent Vivier @ 2022-04-26 10:26 UTC (permalink / raw)
To: Marcel Apfelbaum, Yuval Shaia, QEMU Trivial; +Cc: qemu devel list
Le 05/04/2022 à 12:25, Marcel Apfelbaum a écrit :
> On Sun, Apr 3, 2022 at 12:00 PM Yuval Shaia <yuval.shaia.ml@gmail.com> wrote:
>>
>> Signed-off-by: Yuval Shaia <yuval.shaia.ml@gmail.com>
>> ---
>> hw/rdma/vmw/pvrdma_main.c | 9 +++++----
>> 1 file changed, 5 insertions(+), 4 deletions(-)
>>
>> diff --git a/hw/rdma/vmw/pvrdma_main.c b/hw/rdma/vmw/pvrdma_main.c
>> index 91206dbb8e..aae382af59 100644
>> --- a/hw/rdma/vmw/pvrdma_main.c
>> +++ b/hw/rdma/vmw/pvrdma_main.c
>> @@ -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;
>> }
>> --
>> 2.20.1
>>
>
> cc: QEMU Trivial <qemu-trivial@nongnu.org>
>
> Reviewed-by: Marcel Apfelbaum <marcel.apfelbaum@gmail.com>
Applied to my trivial-patches branch.
Thanks,
Laurent
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-04-26 10:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-04-03 9:58 [PATCH] hw/pvrdma: Some cosmetic fixes Yuval Shaia
2022-04-05 10:25 ` Marcel Apfelbaum
2022-04-26 10:26 ` Laurent Vivier
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.