Re: [FBCON] Could be called outside of a process context. This

Andrew Morton (akpm@digeo.com)
Mon, 14 Apr 2003 18:53:26 -0700


Linux Kernel Mailing List <linux-kernel@vger.kernel.org> wrote:
>
> ChangeSet 1.981, 2003/03/25 10:21:46-08:00, jsimmons@maxwell.earthlink.net
>
> [FBCON] Could be called outside of a process context. This fixes that.
>
>
> ...
> diff -Nru a/drivers/video/console/fbcon.c b/drivers/video/console/fbcon.c
> --- a/drivers/video/console/fbcon.c Mon Apr 14 11:29:45 2003
> +++ b/drivers/video/console/fbcon.c Mon Apr 14 11:29:45 2003
> @@ -985,8 +985,8 @@
>
> size = ((width + 7) >> 3) * height;
>
> - data = kmalloc(size, GFP_KERNEL);
> - mask = kmalloc(size, GFP_KERNEL);
> + data = kmalloc(size, GFP_ATOMIC);
> + mask = kmalloc(size, GFP_ATOMIC);
>
> if (cursor->set & FB_CUR_SETSIZE) {
> memset(data, 0xff, size);

GFP_ATOMIC memory allocations can and will return NULL when the system is
under load. The driver _has_ to check for this, and cope with it.
-
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/