Skip to content

Commit dd57cd5

Browse files
committed
regmap: irq: Free the regmap-irq mutex
JIRA: https://issues.redhat.com/browse/RHEL-109251 Conflicts: drivers/base/regmap/regmap-irq.c - two stanzas changed err_alloc to err_mutex did not apply. I ensured that all instances of err_alloc after the creation the mutex were changed to err_mutex commit 1da3385 Author: Mark Brown <broonie@kernel.org> Date: Fri, 01 Aug 2025 13:37:06 +0000 We do not currently free the mutex allocated by regmap-irq, do so. Tested-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by: Mark Brown <broonie@kernel.org> Link: https://patch.msgid.link/20250731-regmap-irq-nesting-v1-1-98b4d1bf20f0@kernel.org Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
1 parent 5b2b6ba commit dd57cd5

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

drivers/base/regmap/regmap-irq.c

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
767767
d->mask_buf[i],
768768
chip->irq_drv_data);
769769
if (ret)
770-
goto err_alloc;
770+
goto err_mutex;
771771
}
772772

773773
if (chip->mask_base && !chip->handle_mask_sync) {
@@ -778,7 +778,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
778778
if (ret) {
779779
dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
780780
reg, ret);
781-
goto err_alloc;
781+
goto err_mutex;
782782
}
783783
}
784784

@@ -789,7 +789,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
789789
if (ret) {
790790
dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
791791
reg, ret);
792-
goto err_alloc;
792+
goto err_mutex;
793793
}
794794
}
795795

@@ -806,7 +806,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
806806
if (ret != 0) {
807807
dev_err(map->dev, "Failed to read IRQ status: %d\n",
808808
ret);
809-
goto err_alloc;
809+
goto err_mutex;
810810
}
811811
}
812812

@@ -830,7 +830,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
830830
if (ret != 0) {
831831
dev_err(map->dev, "Failed to ack 0x%x: %d\n",
832832
reg, ret);
833-
goto err_alloc;
833+
goto err_mutex;
834834
}
835835
}
836836
}
@@ -852,7 +852,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
852852
if (ret != 0) {
853853
dev_err(map->dev, "Failed to set masks in 0x%x: %d\n",
854854
reg, ret);
855-
goto err_alloc;
855+
goto err_mutex;
856856
}
857857
}
858858
}
@@ -867,7 +867,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
867867
if (!d->domain) {
868868
dev_err(map->dev, "Failed to create IRQ domain\n");
869869
ret = -ENOMEM;
870-
goto err_alloc;
870+
goto err_mutex;
871871
}
872872

873873
ret = request_threaded_irq(irq, NULL, regmap_irq_thread,
@@ -885,6 +885,8 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,
885885

886886
err_domain:
887887
/* Should really dispose of the domain but... */
888+
err_mutex:
889+
mutex_destroy(&d->lock);
888890
err_alloc:
889891
kfree(d->type_buf);
890892
kfree(d->type_buf_def);
@@ -975,6 +977,7 @@ void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)
975977
kfree(d->config_buf[i]);
976978
kfree(d->config_buf);
977979
}
980+
mutex_destroy(&d->lock);
978981
kfree(d);
979982
}
980983
EXPORT_SYMBOL_GPL(regmap_del_irq_chip);

0 commit comments

Comments
 (0)