From: Peter Jones <pjones@redhat.com>
To: linux-fbdev@vger.kernel.org
Subject: Re: [PATCH 2/4] efifb: Fix mismatched request/release_mem_region
Date: Thu, 26 May 2011 14:34:23 +0000 [thread overview]
Message-ID: <4DDE64EF.80109@redhat.com> (raw)
In-Reply-To: <66cbd008789c83ed102f94adf5f3a58392a3519d.1306418703.git.luto@mit.edu>
On 05/26/2011 10:13 AM, Andy Lutomirski wrote:
> Signed-off-by: Andy Lutomirski <luto@mit.edu>
Thanks for spotting this.
Signed-off-by: Peter Jones <pjones@redhat.com>
> ---
> drivers/video/efifb.c | 11 +++++++----
> 1 files changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/video/efifb.c b/drivers/video/efifb.c
> index a81c944..43af770 100644
> --- a/drivers/video/efifb.c
> +++ b/drivers/video/efifb.c
> @@ -16,6 +16,8 @@
> #include <linux/pci.h>
> #include <video/vga.h>
>
> +static bool request_mem_succeeded = false;
> +
> static struct fb_var_screeninfo efifb_defined __devinitdata = {
> .activate = FB_ACTIVATE_NOW,
> .height = -1,
> @@ -281,7 +283,9 @@ static void efifb_destroy(struct fb_info *info)
> {
> if (info->screen_base)
> iounmap(info->screen_base);
> - release_mem_region(info->apertures->ranges[0].base, info->apertures->ranges[0].size);
> + if (request_mem_succeeded)
> + release_mem_region(info->apertures->ranges[0].base,
> + info->apertures->ranges[0].size);
> framebuffer_release(info);
> }
>
> @@ -333,7 +337,6 @@ static int __devinit efifb_probe(struct platform_device *dev)
> unsigned int size_vmode;
> unsigned int size_remap;
> unsigned int size_total;
> - int request_succeeded = 0;
>
> if (!screen_info.lfb_depth)
> screen_info.lfb_depth = 32;
> @@ -387,7 +390,7 @@ static int __devinit efifb_probe(struct platform_device *dev)
> efifb_fix.smem_len = size_remap;
>
> if (request_mem_region(efifb_fix.smem_start, size_remap, "efifb")) {
> - request_succeeded = 1;
> + request_mem_succeeded = true;
> } else {
> /* We cannot make this fatal. Sometimes this comes from magic
> spaces our resource handlers simply don't know about */
> @@ -491,7 +494,7 @@ err_unmap:
> err_release_fb:
> framebuffer_release(info);
> err_release_mem:
> - if (request_succeeded)
> + if (request_mem_succeeded)
> release_mem_region(efifb_fix.smem_start, size_total);
> return err;
> }
--
Peter
If you're not part of the solution, then you're part of the precipitate.
01234567890123456789012345678901234567890123456789012345678901234567890123456789
prev parent reply other threads:[~2011-05-26 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-26 14:13 [PATCH 2/4] efifb: Fix mismatched request/release_mem_region Andy Lutomirski
2011-05-26 14:34 ` Peter Jones [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4DDE64EF.80109@redhat.com \
--to=pjones@redhat.com \
--cc=linux-fbdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.