lkml.org 
[lkml]   [2005]   [Feb]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: sizeof(ptr) or sizeof(*ptr)?
"" <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.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:10    [W:0.110 / U:0.044 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site