Skip to contentSkip to conversation

ARM: 6214/2: fix release_mem_region() size

PATCH In review Thomas Fourier 3 participants 5 messages Dec 16, 2025 – Dec 29, 2025 Auxiliary display drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ARM: 6214/2: fix release_mem_region() size

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in charlcd_remove() but not in the error path in charlcd_probe().

Fixes ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
---
 drivers/auxdisplay/arm-charlcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/auxdisplay/arm-charlcd.c +1 -1
index a7eae99a48f7..4e22882f57c9 100644
@@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
 out_no_irq:
 	iounmap(lcd->virtbase);
 out_no_memregion:
-	release_mem_region(lcd->phybase, SZ_4K);
+	release_mem_region(lcd->phybase, lcd->physize);
 out_no_resource:
 	kfree(lcd);
 	return ret;
Signature · 1 line
2.43.0
reviewer Reviewed-by on v1 1/1
#1 lore raw

Hi Thomas,

Thanks for your patch!

The patch prefix should be "auxdisplay: arm-charlcd:", not an rmk patch tracker ID.

Quoted 3 lines · Thomas Fourier

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in charlcd_remove() but not in the error path in charlcd_probe().

Unfortunately charlcd_remove() was removed in one of these silly "make <foo> explicitly non-modular" patches...

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 325

Quoted 9 lines
Fixes ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
drivers/auxdisplay/arm-charlcd.c +0 -0
@@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
 out_no_irq:
        iounmap(lcd->virtbase);
 out_no_memregion:

Looks like the first "goto out_no_memregion" is incorrect, and should be "goto out_no_resource".

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 329

Quoted 5 lines
drivers/auxdisplay/arm-charlcd.c +1 -1
-       release_mem_region(lcd->phybase, SZ_4K);
+       release_mem_region(lcd->phybase, lcd->physize);
 out_no_resource:
        kfree(lcd);
        return ret;

The actual change LGTM to me, so

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#2 lore raw
Quoted 18 lines · Geert Uytterhoeven

Hi Thomas,

Thanks for your patch!

The patch prefix should be "auxdisplay: arm-charlcd:", not an rmk patch tracker ID.

Quoted 3 lines · Thomas Fourier

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in charlcd_remove() but not in the error path in charlcd_probe().

Unfortunately charlcd_remove() was removed in one of these silly "make <foo> explicitly non-modular" patches...

Quoted 2 lines
Fixes ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
Quoted 9 lines

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 325

Quoted 6 lines
drivers/auxdisplay/arm-charlcd.c +0 -0
@@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
 out_no_irq:
        iounmap(lcd->virtbase);
 out_no_memregion:

Looks like the first "goto out_no_memregion" is incorrect, and should be "goto out_no_resource".

Should it be in this change or in a separate change? I'm not sure I got what should be done about this.

Quoted 8 lines

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 329

Quoted 5 lines
drivers/auxdisplay/arm-charlcd.c +1 -1
-       release_mem_region(lcd->phybase, SZ_4K);
+       release_mem_region(lcd->phybase, lcd->physize);
 out_no_resource:
        kfree(lcd);
        return ret;

The actual change LGTM to me, so

Reading between the lines, should I alter the commit message to mention that there is no more charlcd_remove()? Something like:

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in recently dropped charlcd_remove() but not in the error path in charlcd_probe().

(and Subject line)?

Signature · 2 lines
With Best Regards,
Andy Shevchenko
#3 lore raw

Hi Andy,

Quoted 22 lines · Andy Shevchenko
Quoted 11 lines · Geert Uytterhoeven
Quoted 3 lines · Thomas Fourier

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in charlcd_remove() but not in the error path in charlcd_probe().

Unfortunately charlcd_remove() was removed in one of these silly "make <foo> explicitly non-modular" patches...

Quoted 2 lines
Fixes ce8962455e90 ("ARM: 6214/2: driver for the character LCD found in ARM refdesigns")
Quoted 9 lines

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 325

Quoted 6 lines
drivers/auxdisplay/arm-charlcd.c +0 -0
@@ -323,7 +323,7 @@ static int __init charlcd_probe(struct platform_device *pdev)
 out_no_irq:
        iounmap(lcd->virtbase);
 out_no_memregion:

Looks like the first "goto out_no_memregion" is incorrect, and should be "goto out_no_resource".

Quoted 2 lines

Should it be in this change or in a separate change? I'm not sure I got what should be done about this.

Separate change.

Quoted 12 lines
Quoted 8 lines

drivers/auxdisplay/arm-charlcd.c static int __init charlcd_probe(struct platform_device *pdev) · line 329

Quoted 5 lines
drivers/auxdisplay/arm-charlcd.c +1 -1
-       release_mem_region(lcd->phybase, SZ_4K);
+       release_mem_region(lcd->phybase, lcd->physize);
 out_no_resource:
        kfree(lcd);
        return ret;

The actual change LGTM to me, so

Reading between the lines, should I alter the commit message to mention that there is no more charlcd_remove()? Something like:

Quoted 6 lines

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in recently dropped charlcd_remove() but not in the error path in charlcd_probe().

(and Subject line)?

Yes please. It is very confusing to refer to a function that no longer exists.

Thanks!

Gr{oetje,eeting}s,

Geert

Signature · 5 lines
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
#4 lore raw
In reply to Thomas Fourier
Quoted 3 lines · Thomas Fourier

It seems like, after the request_mem_region(), the corresponding release_mem_region() must take the same size. This was done in charlcd_remove() but not in the error path in charlcd_probe().

Pushed to my review and testing queue, thanks!

Signature · 2 lines
With Best Regards,
Andy Shevchenko