From: Andrew Morton <akpm@osdl.org>
To: "" <pmarques@grupopie.com>
Cc: mdharm-kernel@one-eyed-alien.net, linux-kernel@vger.kernel.org,
perex@suse.cz, luming.yu@intel.com
Subject: Re: sizeof(ptr) or sizeof(*ptr)?
Date: Sun, 27 Feb 2005 21:39:46 -0800 [thread overview]
Message-ID: <20050227213946.199e82af.akpm@osdl.org> (raw)
In-Reply-To: <1109546013.4222541d5db16@webmail.grupopie.com>
"" <pmarques@grupopie.com> wrote:
>
> Anyway, after improving the tool and checking for false positives, there is only
> one more suspicious piece of code in drivers/acpi/video.c:561
>
> status = acpi_video_device_lcd_query_levels(device, &obj);
>
> if (obj && obj->type == ACPI_TYPE_PACKAGE && obj->package.count >= 2) {
> int count = 0;
> union acpi_object *o;
>
> br = kmalloc(sizeof &br, GFP_KERNEL);
yup, bug.
> 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);
And another one, although it happens to work out OK.
I'll get these all fixed up, thanks.
next prev parent reply other threads:[~2005-02-28 5:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-27 20:25 pmarques
2005-02-27 20:45 ` Matthew Dharm
2005-02-27 23:13 ` pmarques
2005-02-28 5:39 ` Andrew Morton [this message]
2005-03-08 13:20 ` Paulo Marques
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=20050227213946.199e82af.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luming.yu@intel.com \
--cc=mdharm-kernel@one-eyed-alien.net \
--cc=perex@suse.cz \
--cc=pmarques@grupopie.com \
/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
Powered by JetHome