From: Alan Cox <alan@lxorguk.ukuu.org.uk>
To: Dave Jones <davej@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: use persistent allocation for cursor blinking.
Date: Tue, 01 Aug 2006 23:17:40 +0100 [thread overview]
Message-ID: <1154470660.15540.92.camel@localhost.localdomain> (raw)
In-Reply-To: <20060801185618.GS22240@redhat.com>
Ar Maw, 2006-08-01 am 14:56 -0400, ysgrifennodd Dave Jones:
> + static u8 *src=NULL;
> + static int allocsize=0;
s/=/ = /
> + if (dsize + sizeof(struct fb_image) != allocsize) {
> + if (src != NULL)
> + kfree(src);
> + allocsize = dsize + sizeof(struct fb_image);
> +
> + src = kmalloc(allocsize, GFP_ATOMIC);
> + if (!src)
> + return -ENOMEM;
> + }
If the allocation fails we have allocsize = "somesize" and src = NULL.
The next time we enter the if is false and we fall through and Oops
Either check src in the if or set allocsize to something impossible (eg
0) on the error path.
NAK
next prev parent reply other threads:[~2006-08-01 21:58 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-08-01 18:56 use persistent allocation for cursor blinking Dave Jones
2006-08-01 19:15 ` Roland Dreier
2006-08-01 19:31 ` Dave Jones
2006-08-01 22:20 ` Alan Cox
2006-08-02 1:20 ` [PATCH] fbcon: Use " Antonino A. Daplas
2006-08-02 1:28 ` [PATCH RESEND] " Antonino A. Daplas
2006-08-02 1:28 ` [PATCH] " Dave Jones
2006-08-01 22:17 ` Alan Cox [this message]
2006-08-01 22:39 ` use " Dave Jones
2006-08-01 23:12 ` Alan Cox
2006-08-05 21:26 ` Pavel Machek
2006-08-06 23:46 ` Antonino A. Daplas
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=1154470660.15540.92.camel@localhost.localdomain \
--to=alan@lxorguk.ukuu.org.uk \
--cc=davej@redhat.com \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox