From: Len Brown <len.brown-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>
Cc: ACPI Developers
<acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>,
pmarques-TSnNRl9vlf1Wk0Htik3J/w@public.gmane.org
Subject: Re: [patch 2/2] acpi video pointer size fix
Date: 30 Mar 2005 22:51:36 -0500 [thread overview]
Message-ID: <1112241095.2175.70.camel@d845pe> (raw)
In-Reply-To: <200503090857.j298v8ln021826-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
Applied.
thanks,
-Len
On Wed, 2005-03-09 at 03:56, akpm-3NddpPZAyC0@public.gmane.org wrote:
> From: Paulo Marques <pmarques-TSnNRl9vlf1Wk0Htik3J/w@public.gmane.org>
>
> Fix two instances where we take &p instead of *p when calculating
> storage
> size.
>
> Also, kfree(NULL) is legal, so remove some unneeded checks.
>
> Signed-off-by: Andrew Morton <akpm-3NddpPZAyC0@public.gmane.org>
> ---
>
> 25-akpm/drivers/acpi/video.c | 13 ++++++-------
> 1 files changed, 6 insertions(+), 7 deletions(-)
>
> diff -puN drivers/acpi/video.c~acpi-video-pointer-size-fix
> drivers/acpi/video.c
> --- 25/drivers/acpi/video.c~acpi-video-pointer-size-fix 2005-03-09
> 00:55:00.000000000 -0800
> +++ 25-akpm/drivers/acpi/video.c 2005-03-09 00:55:00.000000000
> -0800
> @@ -564,12 +564,13 @@ acpi_video_device_find_cap (struct acpi_
> int count = 0;
> union acpi_object *o;
>
> - br = kmalloc(sizeof &br, GFP_KERNEL);
> + br = kmalloc(sizeof(*br), GFP_KERNEL);
> if (!br) {
> printk(KERN_ERR "can't allocate memory\n");
> } else {
> - memset(br, 0, sizeof &br);
> - br->levels = kmalloc(obj->package.count *
> sizeof &br->levels, GFP_KERNEL);
> + memset(br, 0, sizeof(*br));
> + br->levels = kmalloc(obj->package.count *
> + sizeof *(br->levels),
> GFP_KERNEL);
> if (!br->levels)
> goto out;
>
> @@ -584,8 +585,7 @@ acpi_video_device_find_cap (struct acpi_
> }
> out:
> if (count < 2) {
> - if (br->levels)
> - kfree(br->levels);
> + kfree(br->levels);
> kfree(br);
> } else {
> br->count = count;
> @@ -595,8 +595,7 @@ out:
> }
> }
>
> - if (obj)
> - kfree(obj);
> + kfree(obj);
>
> return_VOID;
> }
> _
>
>
-------------------------------------------------------
This SF.net email is sponsored by Demarc:
A global provider of Threat Management Solutions.
Download our HomeAdmin security software for free today!
http://www.demarc.com/Info/Sentarus/hamr30
prev parent reply other threads:[~2005-03-31 3:51 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-09 8:56 [patch 2/2] acpi video pointer size fix akpm-3NddpPZAyC0
[not found] ` <200503090857.j298v8ln021826-bipKiLWnuIsyyg0EjBt7GtHuzzzSOjJt@public.gmane.org>
2005-03-31 3:51 ` Len Brown [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=1112241095.2175.70.camel@d845pe \
--to=len.brown-ral2jqcrhueavxtiumwx3w@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=akpm-3NddpPZAyC0@public.gmane.org \
--cc=pmarques-TSnNRl9vlf1Wk0Htik3J/w@public.gmane.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox