mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Fix loading of large firmware files.
@ 2008-04-17 14:21 thomas
  2008-04-17 17:07 ` [PATCH][Resend] " Thomas Hellstrom
  0 siblings, 1 reply; 2+ messages in thread
From: thomas @ 2008-04-17 14:21 UTC (permalink / raw)
  To: linux-kernel; +Cc: Thomas Hellstrom

From: Thomas Hellstrom <thomas@tungstengraphics.com>

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 4a1b9bf..4215cbf 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -206,7 +206,9 @@ fw_realloc_buffer(struct firmware_priv *
 	if (min_size <= fw_priv->alloc_size)
 		return 0;
 
-	new_size = ALIGN(min_size, PAGE_SIZE);
+	new_size = 2 * new_size;
+	new_size = (min_size > new_size) ? min_size : new_size;
+	new_size = ALIGN(new_size, PAGE_SIZE);
 	new_data = vmalloc(new_size);
 	if (!new_data) {
 		printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__);
-- 
1.4.1



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-04-17 16:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-17 14:21 [PATCH] Fix loading of large firmware files thomas
2008-04-17 17:07 ` [PATCH][Resend] " Thomas Hellstrom

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®