[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [PATCH v2 2/2] xen/arm: vpl011: Fix domain_vpl011_init error path
Hi, On 24/03/2023 09:35, Luca Fancellu wrote: On 23 Mar 2023, at 13:56, Michal Orzel <michal.orzel@xxxxxxx> wrote: When vgic_reserve_virq() fails and backend is in domain, we should also free the allocated event channel. When backend is in Xen and call to xzalloc() returns NULL, there is no need to call xfree(). This should be done instead on an error path from vgic_reserve_virq(). Moreover, we should be calling XFREE() to prevent an extra free in domain_vpl011_deinit(). In order not to repeat the same steps twice, call domain_vpl011_deinit() on an error path whenever there is more work to do than returning rc. Since this function can now be called from different places and more than once, add proper guards, use XFREE() instead of xfree() and move vgic_free_virq() to it. Take the opportunity to return -ENOMEM instead of -EINVAL when memory allocation fails. Fixes: 1ee1e4b0d1ff ("xen/arm: Allow vpl011 to be used by DomU") Signed-off-by: Michal Orzel <michal.orzel@xxxxxxx>Reviewed-by: Luca Fancellu <luca.fancellu@xxxxxxx> Reviewed-by: Julien Grall <jgrall@xxxxxxxxxx> And committed the series. Cheers, -- Julien Grall
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |