qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] [PULL 04/32] xlnx-zdma: Add a model of the Xilinx ZynqMP ge


From: francisco iglesias
Subject: [Qemu-devel] [PULL 04/32] xlnx-zdma: Add a model of the Xilinx ZynqMP generic DMA
Date: Fri, 25 May 2018 18:24:09 +0200

On Friday, 25 May 2018, Peter Maydell <address@hidden> wrote:

> On 18 May 2018 at 18:19, Peter Maydell <address@hidden> wrote:
> > From: Francisco Iglesias <address@hidden>
> >
> > Add a model of the generic DMA found on Xilinx ZynqMP.
>
> Hi; the latest Coverity run finds a couple of issues in this code:
>
>
> > +static uint64_t zdma_read(void *opaque, hwaddr addr, unsigned size)
> > +{
> > +    XlnxZDMA *s = XLNX_ZDMA(opaque);
> > +    RegisterInfo *r = &s->regs_info[addr / 4];
> > +
> > +    if (!r->data) {
> > +        qemu_log("%s: Decode error: read from %" HWADDR_PRIx "\n",
> > +                 object_get_canonical_path(OBJECT(s)),
> > +                 addr);
>
> object_get_canonical_path() returns a string that the caller
> takes ownership of, so you have to g_free() it when you've
> finished with it. (CID 1391294)
>
> > +        ARRAY_FIELD_DP32(s->regs, ZDMA_CH_ISR, INV_APB, true);
> > +        zdma_ch_imr_update_irq(s);
> > +        return 0;
> > +    }
> > +    return register_read(r, ~0, NULL, false);
> > +}
> > +
> > +static void zdma_write(void *opaque, hwaddr addr, uint64_t value,
> > +                      unsigned size)
> > +{
> > +    XlnxZDMA *s = XLNX_ZDMA(opaque);
> > +    RegisterInfo *r = &s->regs_info[addr / 4];
> > +
> > +    if (!r->data) {
> > +        qemu_log("%s: Decode error: write to %" HWADDR_PRIx "=%" PRIx64
> "\n",
> > +                 object_get_canonical_path(OBJECT(s)),
> > +                 addr, value);
>
> Similarly here. (CID 1391293)
>
> > +        ARRAY_FIELD_DP32(s->regs, ZDMA_CH_ISR, INV_APB, true);
> > +        zdma_ch_imr_update_irq(s);
> > +        return;
> > +    }
> > +    register_write(r, value, ~0, NULL, false);
> > +}
>
> Could you write a patch that adds the missing g_free()s, please?
>
> Hi Peter,

Absolutly! I'll be back with a patch with the corrections asap! Thank you
for explaining the issues!

Brst regards,
Francisco Iglesias





> thanks
> -- PMM
>


reply via email to

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