qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-2.9] virtio: Fix error handling in virtio_bu


From: Cornelia Huck
Subject: Re: [Qemu-devel] [PATCH for-2.9] virtio: Fix error handling in virtio_bus_device_plugged
Date: Fri, 17 Mar 2017 13:28:26 +0100

On Fri, 17 Mar 2017 13:18:16 +0100
Andrew Jones <address@hidden> wrote:

> On Fri, Mar 17, 2017 at 07:33:53PM +0800, Fam Zheng wrote:
> > For one thing we shouldn't continue if an error happened, for the other
> > two steps failing can cause an abort() in error_setg because we reuse
> > the same errp blindly.
> > 
> > Add error handling checks to fix both issues.
> > 
> > Signed-off-by: Fam Zheng <address@hidden>
> > ---
> >  hw/virtio/virtio-bus.c | 18 ++++++++++++++++--
> >  1 file changed, 16 insertions(+), 2 deletions(-)

> >  
> >      if (klass->device_plugged != NULL) {
> >          klass->device_plugged(qbus->parent, errp);
> 
> Did you intend to change this errp to &local_err, as well? If not,
> then the body of the below hunk is unreachable, as local_err can
> never be non-null there.

Oh, I managed to overlook this.

So my r-b applies if this is changed to use local_err :)

> 
> Thanks,
> drew
> 
> >      }
> > +    if (local_err) {
> > +        error_propagate(errp, local_err);
> > +        return;
> > +    }
> >  
> >      if (klass->get_dma_as != NULL && has_iommu) {
> >          virtio_add_feature(&vdev->host_features, VIRTIO_F_IOMMU_PLATFORM);
> > -- 
> > 2.9.3
> > 
> > 
> 
> 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]