Re: [PATCH v3 1/6] ppc/spapr: Add VFIO EEH error injection backend

Nikhil Kumar Singh <[email protected]>
Newsgroups org.nongnu.qemu-devel
Message-ID <[email protected]>

On 20/05/26 15:24, Narayana Murty N wrote:
> +    VFIOLegacyContainer *container = vfio_eeh_as_container(&sphb->iommu_as);
> +    struct vfio_eeh_pe_op op = {
> +        .op = VFIO_EEH_PE_INJECT_ERR,
> +        .argsz = sizeof(op),
> +    };
> +
[...]
> +    /* Perform the ioctl to inject the error */
> +    if (ioctl(container->fd, VFIO_EEH_PE_OP, &op) < 0) {
> +        return RTAS_OUT_HW_ERROR;
> +    }

Hi Narayana,

Sorry, one detail I missed in my previous review:

Could `container` be NULL here if `vfio_eeh_as_container()` fails or 
returns NULL? If so, should we add a NULL check before dereferencing 
`container->fd`?

Thanks,
Nikhil
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.