Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 22008
b: refs/heads/master
c: 30560ba
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Moyer authored and Greg Kroah-Hartman committed Mar 20, 2006
1 parent 40dfe12 commit 688af85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 58d49283b87751f7af75e021a629dcddb027e8eb
refs/heads/master: 30560ba6eda308c13a361d08eb5d4eaab94ab37e
6 changes: 4 additions & 2 deletions trunk/drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,20 @@ static int
fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size)
{
u8 *new_data;
int new_size = fw_priv->alloc_size;

if (min_size <= fw_priv->alloc_size)
return 0;

new_data = vmalloc(fw_priv->alloc_size + PAGE_SIZE);
new_size = ALIGN(min_size, PAGE_SIZE);
new_data = vmalloc(new_size);
if (!new_data) {
printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__);
/* Make sure that we don't keep incomplete data */
fw_load_abort(fw_priv);
return -ENOMEM;
}
fw_priv->alloc_size += PAGE_SIZE;
fw_priv->alloc_size = new_size;
if (fw_priv->fw->data) {
memcpy(new_data, fw_priv->fw->data, fw_priv->fw->size);
vfree(fw_priv->fw->data);
Expand Down

0 comments on commit 688af85

Please sign in to comment.