[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH PULL v2 08/10] hw/rdma: PVRDMA commands and data
From: |
Marcel Apfelbaum |
Subject: |
Re: [Qemu-devel] [PATCH PULL v2 08/10] hw/rdma: PVRDMA commands and data-path ops |
Date: |
Fri, 27 Apr 2018 21:28:15 +0300 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 |
On 27/04/2018 17:58, Peter Maydell wrote:
> On 19 February 2018 at 11:43, Marcel Apfelbaum <address@hidden> wrote:
>> From: Yuval Shaia <address@hidden>
>>
>> First PVRDMA sub-module - implementation of the PVRDMA device.
>> - PVRDMA commands such as create CQ and create MR.
>> - Data path QP operations - post_send and post_recv.
>> - Completion handler.
>
>> +void pvrdma_cq_poll(RdmaDeviceResources *dev_res, uint32_t cq_handle)
>> +{
>> + RdmaRmCQ *cq;
>> +
>> + cq = rdma_rm_get_cq(dev_res, cq_handle);
>> + if (!cq) {
>> + pr_dbg("Invalid CQ# %d\n", cq_handle);
>> + }
>> +
>> + rdma_backend_poll_cq(dev_res, &cq->backend_cq);
>> +}
>
> Coverity CID 1390586: we check for cq being NULL, but then
> go ahead and use it anyway. If a NULL cq is a possible
> situation we should handle it correctly (early return?
> return an error value that the caller has to handle?
> something else?); if it is not possible then we should
> use assert rather than an if().
The cq_handle is provided by the guest, the code assumes
a sane guest, which is not safe.
I will change the code to return early.
Thanks,
Marcel
>
> thanks
> -- PMM
>