Peter Xu <pet...@redhat.com> writes:

> On Mon, Sep 18, 2023 at 04:41:34PM +0200, Markus Armbruster wrote:
>> qemu_rdma_data_init() neglects to set an Error when it fails because
>> @host_port is null.  Fortunately, no caller passes null, so this is
>
> Indeed they all seem to be non-null.
>
> Before this patch, qemu_rdma_data_init() can still tolerant NULL, not
> setting errp but still returning NULL showing an error.

Returning failure without setting an error is wrong :)

> After this patch, qemu_rdma_data_init() should crash at inet_parse() if
> it's null.

Yes.

> Would it be simpler and clearer if we just set ERROR() for !host_port?

I dislike impossible error paths, because they are untestable.

> Thanks,
>
>> merely a latent bug.  Drop the flawed code handling null argument.
>> 
>> Signed-off-by: Markus Armbruster <arm...@redhat.com>


Reply via email to