The driver forgets to free the I/O region in remove and probe
failure.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <redacted>
---
Changes in v3:
- Revise the commit message.
- Add an error handler to suit the "goto error" before request_region().
- Revise the order of operations in remove.
drivers/video/fbdev/vesafb.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
The driver forgets to free the I/O region in remove and probe
failure.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <redacted>
---
Changes in v3:
- Revise the commit message.
- Add an error handler to suit the "goto error" before request_region().
- Revise the order of operations in remove.
drivers/video/fbdev/vesafb.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
This is incorrect.
The cleanup order should be the reverse of the probing order.
Also request_region() return value is not checked by the driver
(there is a comment that it can fail and is optional):
/* request failure does not faze us, as vgacon probably has this
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
so what would happen in such case? It seems that unconditionally
doing the release will result in freeing the I/O region owned by
the other driver (vgacon)..
quoted hunk
err:
arch_phys_wc_del(par->wc_cookie);
if (info->screen_base)
On Fri, Mar 20, 2020 at 8:01 PM Bartlomiej Zolnierkiewicz
[off-list ref] wrote:
On 3/10/20 3:35 AM, Chuhong Yuan wrote:
quoted
The driver forgets to free the I/O region in remove and probe
failure.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <redacted>
---
Changes in v3:
- Revise the commit message.
- Add an error handler to suit the "goto error" before request_region().
- Revise the order of operations in remove.
drivers/video/fbdev/vesafb.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
This is incorrect.
The cleanup order should be the reverse of the probing order.
Also request_region() return value is not checked by the driver
(there is a comment that it can fail and is optional):
/* request failure does not faze us, as vgacon probably has this
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
so what would happen in such case? It seems that unconditionally
doing the release will result in freeing the I/O region owned by
the other driver (vgacon)..
Maybe we can add a field to represent whether the request succeeds?
request_region() returns source *, we can store it and check whether
it is null when
we are going to call release_region().
quoted
err:
arch_phys_wc_del(par->wc_cookie);
if (info->screen_base)
On Fri, Mar 20, 2020 at 8:01 PM Bartlomiej Zolnierkiewicz
[off-list ref] wrote:
quoted
On 3/10/20 3:35 AM, Chuhong Yuan wrote:
quoted
The driver forgets to free the I/O region in remove and probe
failure.
Add the missed calls to fix it.
Signed-off-by: Chuhong Yuan <redacted>
---
Changes in v3:
- Revise the commit message.
- Add an error handler to suit the "goto error" before request_region().
- Revise the order of operations in remove.
drivers/video/fbdev/vesafb.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
This is incorrect.
The cleanup order should be the reverse of the probing order.
Also request_region() return value is not checked by the driver
(there is a comment that it can fail and is optional):
/* request failure does not faze us, as vgacon probably has this
* region already (FIXME) */
request_region(0x3c0, 32, "vesafb");
so what would happen in such case? It seems that unconditionally
doing the release will result in freeing the I/O region owned by
the other driver (vgacon)..
Maybe we can add a field to represent whether the request succeeds?
request_region() returns source *, we can store it and check whether
it is null when
we are going to call release_region().
Yes, this is a preferred approach.
Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics
quoted
quoted
err:
arch_phys_wc_del(par->wc_cookie);
if (info->screen_base)