* [PATCH v2] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe()
@ 2024-08-01 20:34 Christophe JAILLET
2024-08-01 20:48 ` Helge Deller
0 siblings, 1 reply; 2+ messages in thread
From: Christophe JAILLET @ 2024-08-01 20:34 UTC (permalink / raw)
To: Helge Deller
Cc: linux-kernel, kernel-janitors, Christophe JAILLET, linux-fbdev,
dri-devel
If an error occurs after request_mem_region(), a corresponding
release_mem_region() should be called, as already done in the remove
function.
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
*Not* even compile tested only.
It is provided as-is
Changes in v2:
- Apply a minimal change [Helge Deller]
v1: https://lore.kernel.org/all/dc4fe3d857849ac63131c5620f1bacf1a3d7172e.1722191367.git.christophe.jaillet@wanadoo.fr/
---
drivers/video/fbdev/hpfb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/video/fbdev/hpfb.c b/drivers/video/fbdev/hpfb.c
index 66fac8e5393e..a1144b150982 100644
--- a/drivers/video/fbdev/hpfb.c
+++ b/drivers/video/fbdev/hpfb.c
@@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
if (hpfb_init_one(paddr, vaddr)) {
if (d->scode >= DIOII_SCBASE)
iounmap((void *)vaddr);
+ release_mem_region(d->resource.start, resource_size(&d->resource));
return -ENOMEM;
}
return 0;
--
2.45.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe()
2024-08-01 20:34 [PATCH v2] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe() Christophe JAILLET
@ 2024-08-01 20:48 ` Helge Deller
0 siblings, 0 replies; 2+ messages in thread
From: Helge Deller @ 2024-08-01 20:48 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: linux-kernel, kernel-janitors, linux-fbdev, dri-devel
On 8/1/24 22:34, Christophe JAILLET wrote:
> If an error occurs after request_mem_region(), a corresponding
> release_mem_region() should be called, as already done in the remove
> function.
>
> Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
I've applied it as-is (with the Fixes tag) to the fbdev git tree.
Thank you, Christophe!
Helge
> ---
> *Not* even compile tested only.
> It is provided as-is
>
> Changes in v2:
> - Apply a minimal change [Helge Deller]
>
> v1: https://lore.kernel.org/all/dc4fe3d857849ac63131c5620f1bacf1a3d7172e.1722191367.git.christophe.jaillet@wanadoo.fr/
> ---
> drivers/video/fbdev/hpfb.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/fbdev/hpfb.c b/drivers/video/fbdev/hpfb.c
> index 66fac8e5393e..a1144b150982 100644
> --- a/drivers/video/fbdev/hpfb.c
> +++ b/drivers/video/fbdev/hpfb.c
> @@ -345,6 +345,7 @@ static int hpfb_dio_probe(struct dio_dev *d, const struct dio_device_id *ent)
> if (hpfb_init_one(paddr, vaddr)) {
> if (d->scode >= DIOII_SCBASE)
> iounmap((void *)vaddr);
> + release_mem_region(d->resource.start, resource_size(&d->resource));
> return -ENOMEM;
> }
> return 0;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-01 20:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-01 20:34 [PATCH v2] fbdev/hpfb: Fix an error handling path in hpfb_dio_probe() Christophe JAILLET
2024-08-01 20:48 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).