Re: [PATCH v2] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-08-31 Thread Zhao Liu
Hi Michael, On Tue, Aug 20, 2024 at 06:55:29AM -0400, Michael S. Tsirkin wrote: [snip] > > diff --git a/hw/virtio/vdpa-dev.c b/hw/virtio/vdpa-dev.c > > index 64b96b226c39..8a1e16fce3de 100644 > > --- a/hw/virtio/vdpa-dev.c > > +++ b/hw/virtio/vdpa-dev.c > > @@ -63,19 +63,19 @@ static void vhost_

Re: [PATCH v2] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-08-20 Thread Michael S. Tsirkin
On Wed, Jul 17, 2024 at 12:26:15AM +0800, Zhao Liu wrote: > As the comment in qapi/error, dereferencing @errp requires > ERRP_GUARD(): > > * = Why, when and how to use ERRP_GUARD() = > * > * Without ERRP_GUARD(), use of the @errp parameter is restricted: > * - It must not be dereferenced, because

[PATCH v2] hw/virtio/vdpa-dev: Check returned value instead of dereferencing @errp

2024-07-16 Thread Zhao Liu
As the comment in qapi/error, dereferencing @errp requires ERRP_GUARD(): * = Why, when and how to use ERRP_GUARD() = * * Without ERRP_GUARD(), use of the @errp parameter is restricted: * - It must not be dereferenced, because it may be null. ... * ERRP_GUARD() lifts these restrictions. * * To use