Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] amdxdna: partition leak in aie4_vf_hw_start() error path
--

commit bc6bbbe04622b7e463790d57007bb4c50fb33683
Author: David Zhang <[email protected]>

    accel/amdxdna: Add get and set power_mode for AIE4

This commit adds power mode support for AIE4 devices via DRM_AMDXDNA_GET_INFO
and DRM_AMDXDNA_SET_STATE. It implements aie4_set_power_mode() and restores
the cached user power mode override whenever the hardware starts.

> diff --git a/drivers/accel/amdxdna/aie4_pci.c 
> b/drivers/accel/amdxdna/aie4_pci.c
> index aea3edd51b4f5..d11bdbf168816 100644
> --- a/drivers/accel/amdxdna/aie4_pci.c
> +++ b/drivers/accel/amdxdna/aie4_pci.c
[ ... ]
> @@ -346,6 +373,10 @@ static int aie4_vf_hw_start(struct amdxdna_dev_hdl *ndev)
>       if (ret)
>               goto mailbox_fini;
>  
> +     ret = aie4_restore_power_mode(ndev);
> +     if (ret)
> +             goto mailbox_fini;
> +

[Severity: Medium]
Does this error path leak the firmware hardware partition?

If aie4_restore_power_mode() fails here, we jump directly to the mailbox_fini
label. This bypasses aie4_partition_fini(), leaving the partition that was
successfully initialized just prior to this call permanently leaked.

>       return 0;
>  
>  mailbox_fini:
>       aie4_mailbox_fini(ndev);

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=7

Reply via email to