[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1177260725.4268.9.camel@mulgrave.il.steeleye.com>
Date: Sun, 22 Apr 2007 11:52:05 -0500
From: James Bottomley <James.Bottomley@...elEye.com>
To: Guennadi Liakhovetski <g.liakhovetski@....de>
Cc: linux-kernel@...r.kernel.org
Subject: Re: [PATCH] dma_declare_coherent_memory wrong allocation
On Fri, 2007-04-13 at 20:08 +0200, Guennadi Liakhovetski wrote:
> Either I've finally gone blind on this Friday 13th or... Looks like this
> almost 3 year old function has a bug. Patch below compile-tested... in a
> way.
No, it's a longstanding bug in the x86 implementation, thanks for
finding it.
> - int bitmap_size = (pages + 31)/32;
> + int bitmap_size = DIV_ROUND_UP(pages, 8);
This isn't quite right. Bitmaps are arrays of longs, not arrays of
bytes. The bug is forgetting that kmalloc() takes bytes ...
How about
int bitmap_size = DIV_ROUNDUP(pages, 32) * 4;
?
James
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists