]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
firmware: arm_ffa: Unmap Rx/Tx buffers on init failure
authorHaoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Wed, 10 Dec 2025 03:16:56 +0000 (11:16 +0800)
committerSudeep Holla <sudeep.holla@arm.com>
Mon, 15 Dec 2025 10:31:15 +0000 (10:31 +0000)
ffa_init() maps the Rx/Tx buffers via ffa_rxtx_map() but on the
partition setup failure path it never unmaps them.

Add the missing ffa_rxtx_unmap() call in the error path so that
the Rx/Tx buffers are properly released before freeing the backing
pages.

Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
Message-Id: <20251210031656.56194-1-lihaoxiang@isrc.iscas.ac.cn>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
drivers/firmware/arm_ffa/driver.c

index c72ee475658569dd84d30fd588a4cb3576dbaa03..7209a630f6d16ddc3a6a8a6e97e3030185209711 100644 (file)
@@ -2068,6 +2068,7 @@ static int __init ffa_init(void)
 
        pr_err("failed to setup partitions\n");
        ffa_notifications_cleanup();
+       ffa_rxtx_unmap(drv_info->vm_id);
 free_pages:
        if (drv_info->tx_buffer)
                free_pages_exact(drv_info->tx_buffer, rxtx_bufsz);