On 18 May 2018 at 18:19, Peter Maydell <[email protected]> wrote:
> From: Francisco Iglesias <[email protected]>
>
> Add a model of the generic DMA found on Xilinx ZynqMP.
> +static bool zdma_load_descriptor(XlnxZDMA *s, uint64_t addr, void *buf)
> +{
> + /* ZDMA descriptors must be aligned to their own size. */
> + if (addr % sizeof(XlnxZDMADescr)) {
> + qemu_log_mask(LOG_GUEST_ERROR,
> + "zdma: unaligned descriptor at %" PRIx64,
> + addr);
> + memset(buf, 0xdeadbeef, sizeof(XlnxZDMADescr));
Another Coverity issue (CID 1391286). memset() doesn't work like this:
its second argument is a byte, so passing anything larger than 255
doesn't make sense.
+ s->error = true;
+ return false;
+ }
thanks
-- PMM