char *desc_get_buf(DescInfo *info, bool read_only)

{

    PCIDevice *dev = PCI_DEVICE(info->ring->r);

    size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) :

                              le16_to_cpu(info->desc.buf_size);



    if (size > info->buf_size) {

        info->buf = g_realloc(info->buf, size);

        info->buf_size = size;

    }



    if (!info->buf) {

        return NULL;

    }



    pci_dma_read(dev, le64_to_cpu(info->desc.buf_addr), info->buf, size);



    return info->buf;

}

char *desc_get_buf(DescInfo *info, bool read_only)

{

    PCIDevice *dev = PCI_DEVICE(info->ring->r);

    size_t size = read_only ? le16_to_cpu(info->desc.tlv_size) :

                              le16_to_cpu(info->desc.buf_size);



    if (size > info->buf_size) {

        info->buf = g_realloc(info->buf, size);

        info->buf_size = size;

    }



    if (!info->buf) {

        return NULL;

    }



    pci_dma_read(dev, le64_to_cpu(info->desc.buf_addr), info->buf, size);



    return info->buf;

}

    if (!info->buf) {         return NULL;         return NULL;         return NULL;         return NULL;         return NULL;
char *FUNC_0(DescInfo *VAR_0, bool VAR_1)

{

    PCIDevice *dev = PCI_DEVICE(VAR_0->ring->r);

    size_t size = VAR_1 ? le16_to_cpu(VAR_0->desc.tlv_size) :

                              le16_to_cpu(VAR_0->desc.buf_size);



    if (size > VAR_0->buf_size) {

        VAR_0->buf = g_realloc(VAR_0->buf, size);

        VAR_0->buf_size = size;

    }



    if (!VAR_0->buf) {

        return NULL;

    }



    pci_dma_read(dev, le64_to_cpu(VAR_0->desc.buf_addr), VAR_0->buf, size);



    return VAR_0->buf;

}

char *FUNC_0(DescInfo *VAR_0, bool VAR_1)
{ PCIDevice *dev = PCI_DEVICE(VAR_0->ring->r); size_t size = VAR_1 ? le16_to_cpu(VAR_0->desc.tlv_size) :
le16_to_cpu(VAR_0->desc.buf_size); if (size > VAR_0->buf_size) { VAR_0->buf = g_realloc(VAR_0->buf, size); VAR_0->buf_size = size; } if (!VAR_0->buf) { return NULL; } pci_dma_read(dev, le64_to_cpu(VAR_0->desc.buf_addr), VAR_0->buf, size); return VAR_0->buf; }