On Mon, 4 May 2026 at 12:38, Marc-André Lureau
<[email protected]> wrote:
>
> The type-checking macros (XLNX_DPDMA(val)) which crash on NULL.
>
> Signed-off-by: Marc-André Lureau <[email protected]>
> ---
>  hw/display/xlnx_dp.c | 6 ++++++
>  1 file changed, 6 insertions(+)
>
> diff --git a/hw/display/xlnx_dp.c b/hw/display/xlnx_dp.c
> index 50e6ef10984..876cb3d6642 100644
> --- a/hw/display/xlnx_dp.c
> +++ b/hw/display/xlnx_dp.c
> @@ -570,6 +570,12 @@ static void xlnx_dp_set_dpdma(const Object *obj, const 
> char *name, Object *val,
>                                Error **errp)
>  {
>      XlnxDPState *s = XLNX_DP(obj);
> +
> +    if (!val) {
> +        error_setg(errp, "%s cannot be set to NULL", name);
> +        return;
> +    }
> +
>      if (s->console) {
>          DisplaySurface *surface = qemu_console_surface(s->console);
>          XlnxDPDMAState *dma = XLNX_DPDMA(val);

What fails here? XLNX_DPDMA(val) should handle NULL, as mentioned
on the other patch. And xlnx_dpdma_set_host_data_location() checks
for a NULL argument.

thanks
-- PMM

Reply via email to