From: thomas@tungstengraphics.com
To: linux-kernel@vger.kernel.org
Cc: Thomas Hellstrom <thomas@tungstengraphics.com>
Subject: [PATCH] Fix loading of large firmware files.
Date: Thu, 17 Apr 2008 16:21:40 +0200 [thread overview]
Message-ID: <12084421001860-git-send-email-thomas@tungstengraphics.com> (raw)
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
next reply other threads:[~2008-04-17 14:38 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-17 14:21 thomas [this message]
2008-04-17 17:07 ` [PATCH][Resend] " Thomas Hellstrom
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=12084421001860-git-send-email-thomas@tungstengraphics.com \
--to=thomas@tungstengraphics.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
all inboxes | Powered by JetHome®