regmap-irq: Add missing kfree()
Subsystems (3)
PATCH 1/1 regmap-irq: Add missing kfree()
Add kfree() for "d->main_status_buf" in the error-handling path to prevent a memory leak.
--- drivers/base/regmap/regmap-irq.c | 1 + 1 file changed, 1 insertion(+)
drivers/base/regmap/regmap-irq.c +1 -0
@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {
Signature · 1 line
2.25.1
Greg KH
maintainerQuoted 26 lines · Jiasheng Jiang
Add
kfree()for "d->main_status_buf" in the error-handling path to prevent a memory leak.Fixes a2d21848d921 ("regmap: regmap-irq: Add main status register support")Cc <[email protected]>Signed-off-by Jiasheng Jiang <[email protected]>--- drivers/base/regmap/regmap-irq.c | 1 + 1 file changed, 1 insertion(+)drivers/base/regmap/regmap-irq.c +1
-0@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {Signature · 1 line
2.25.1
Hi,
This is the friendly patch-bot of Greg Kroah-Hartman. You have sent him a patch that has triggered this response. He used to manually respond to these common problems, but in order to save his sanity (he kept writing the same thing over and over, yet to different people), I was created. Hopefully you will not take offence and will fix the problem in your patch and resubmit it so that it can be accepted into the Linux kernel tree.
You are receiving this message because of the following common error(s) as indicated below:
- This looks like a new version of a previously submitted patch, but you did not list below the --- line any changes from the previous version. Please read the section entitled "The canonical patch format" in the kernel file, Documentation/process/submitting-patches.rst for what needs to be done here to properly describe this.
If you wish to discuss this problem further, or you have questions about how to resolve this issue, please feel free to respond to this email and Greg will reply once he has dug out from the pending patches received from other developers.
thanks,
greg k-h's patch email bot
PATCH v2 1/1 regmap-irq: Add missing kfree()
Add kfree() for "d->main_status_buf" in the error-handling path to prevent a memory leak.
---
Changelog:
v1 -> v2:
1. Add a cc: stable line.
--- drivers/base/regmap/regmap-irq.c | 1 + 1 file changed, 1 insertion(+)
drivers/base/regmap/regmap-irq.c +1 -0
@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {
Signature · 1 line
2.25.1
Thanks Jiang!
Quoted 6 lines · Jiasheng Jiang
Add
kfree()for "d->main_status_buf" in the error-handling path to prevent a memory leak.Fixes a2d21848d921 ("regmap: regmap-irq: Add main status register support")Cc <[email protected]>Signed-off-by Jiasheng Jiang <[email protected]>
This looks valid to me.
I still wonder if you could fix also the missing freeing from the regmap_del_irq_chip()? (AFAICS, the freeing is missing from that as well).
Quoted 16 lines
--- drivers/base/regmap/regmap-irq.c | 1 + 1 file changed, 1 insertion(+)drivers/base/regmap/regmap-irq.c +1
-0@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {
PATCH v3 1/1 regmap-irq: Add missing kfree()
Add kfree() for "d->main_status_buf" to the error-handling path to prevent a memory leak.
---
Changelog:
v2 -> v3:
1. Add kfree() to regmap_del_irq_chip().
v1 -> v2:
1. Add a cc: stable line.
--- drivers/base/regmap/regmap-irq.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/base/regmap/regmap-irq.c +2 -0
@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {
@@ -981,6 +982,7 @@ void regmap_del_irq_chip(int irq, struct regmap_irq_chip_data *d)kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_reg_buf);kfree (d->status_buf);if (d->config_buf) {
Signature · 1 line
2.25.1
Mark Brown
maintainerQuoted 4 lines · Jiasheng Jiang
Add
kfree()for "d->main_status_buf" to the error-handling path to prevent a memory leak.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/1] regmap-irq: Add missing kfree()
commit: 32ffed055dcee17f6705f545b069e44a66067808
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark
Hi Matti,
Quoted 7 lines · Matti Vaittinen
Thanks Jiang!
Quoted 3 lines · Jiasheng Jiang
Add
kfree()for "d->main_status_buf" in the error-handling path to prevent a memory leak.
Quoted 8 lines
Quoted 3 lines
Fixes a2d21848d921 ("regmap: regmap-irq: Add main status register support")Cc <[email protected]>Signed-off-by Jiasheng Jiang <[email protected]>This looks valid to me.
I still wonder if you could fix also the missing freeing from the
regmap_del_irq_chip()? (AFAICS, the freeing is missing from that as well).
Thanks for your help.
I have submitted a v2 to fix it.
-Jiasheng
Quoted 18 lines
Quoted 17 lines
--- drivers/base/regmap/regmap-irq.c | 1 + 1 file changed, 1 insertion(+)drivers/base/regmap/regmap-irq.c +1
-0@@ -906,6 +906,7 @@ int regmap_add_irq_chip_fwnode(struct fwnode_handle *fwnode,kfree (d->wake_buf);kfree (d->mask_buf_def);kfree (d->mask_buf); +kfree (d->main_status_buf);kfree (d->status_buf);kfree (d->status_reg_buf);if (d->config_buf) {
Mark Brown
maintainerQuoted 4 lines · Jiasheng Jiang
Add
kfree()for "d->main_status_buf" in the error-handling path to prevent a memory leak.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap.git for-next
Thanks!
[1/1] regmap-irq: Add missing kfree()
commit: 32ffed055dcee17f6705f545b069e44a66067808
All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying to this mail.
Thanks,
Mark