[PATCH 10/10] irqchip/gic-v5: Release ITS MMIO region on DT probe failure

Sascha Bischoff sascha.bischoff at arm.com
Wed Nov 4 09:37:29 PST 2026



On 02/11/2026 14:54, Lorenzo Pieralisi wrote:
> On Mon, Nov 02, 2026 at 01:33:03PM +0000, Sascha Bischoff wrote:
>> of_io_request_and_map() reserves the ITS configuration frame region.
>> If ITS initialisation fails after mapping it, the error path only
>> unmaps the registers and leaves the region reserved.
>>
>> Keep the resource description and release the region on that path.
>>
>> Fixes: 57d72196dfc85 ("irqchip/gic-v5: Add GICv5 ITS support")
>> Signed-off-by: Sascha Bischoff <sascha.bischoff at arm.com>
>> ---
>>   drivers/irqchip/irq-gic-v5-its.c | 7 +++++++
>>   1 file changed, 7 insertions(+)
> 
> A minor note on coding style below, other than that:
> 
> Acked-by: Lorenzo Pieralisi <lpieralisi at kernel.org>
>>
>> diff --git a/drivers/irqchip/irq-gic-v5-its.c b/drivers/irqchip/irq-gic-v5-its.c
>> index c0f3982229194..91abe63cb5cf9 100644
>> --- a/drivers/irqchip/irq-gic-v5-its.c
>> +++ b/drivers/irqchip/irq-gic-v5-its.c
>> @@ -1188,6 +1188,7 @@ static int __init gicv5_its_init_bases(void __iomem *its_base, struct fwnode_han
>>   
>>   static int __init gicv5_its_init(struct device_node *node)
>>   {
>> +	struct resource res;
> 
> FIR tree ordering.

Argh, yup. Missed that one when making this change. Fixed!

Thanks,
Sascha

> 
> https://docs.kernel.org/process/maintainer-tip.html
> 
>>   	void __iomem *its_base;
>>   	int ret, idx;
>>   
>> @@ -1197,6 +1198,11 @@ static int __init gicv5_its_init(struct device_node *node)
>>   		return -ENODEV;
>>   	}
>>   
>> +	/* Save the region to release if ITS setup fails after mapping it. */
>> +	ret = of_address_to_resource(node, idx, &res);
>> +	if (ret)
>> +		return ret;
>> +
>>   	its_base = of_io_request_and_map(node, idx, of_node_full_name(node));
>>   	if (IS_ERR(its_base)) {
>>   		pr_err("%pOF: unable to map GICv5 ITS_CONFIG_FRAME\n", node);
>> @@ -1213,6 +1219,7 @@ static int __init gicv5_its_init(struct device_node *node)
>>   
>>   out_unmap:
>>   	iounmap(its_base);
>> +	release_mem_region(res.start, resource_size(&res));
>>   	return ret;
>>   }
>>   
>>
>> -- 
>> 2.34.1
>>




More information about the linux-arm-kernel mailing list