Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 223331
b: refs/heads/master
c: 863abad
h: refs/heads/master
i:
  223329: 6f47047
  223327: a2a8884
v: v3
  • Loading branch information
Jesper Juhl authored and Ralf Baechle committed Dec 16, 2010
1 parent e23d9df commit 414b4ac
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 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: d62c9ced7ca783e64ff4d9d3d1340cfe2284d47b
refs/heads/master: 863abad4f644b6c12bc8176206b35fa7e7cfe1a9
14 changes: 6 additions & 8 deletions trunk/arch/mips/kernel/vpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1092,6 +1092,10 @@ static int vpe_open(struct inode *inode, struct file *filp)

/* this of-course trashes what was there before... */
v->pbuffer = vmalloc(P_SIZE);
if (!v->pbuffer) {
pr_warning("VPE loader: unable to allocate memory\n");
return -ENOMEM;
}
v->plen = P_SIZE;
v->load_addr = NULL;
v->len = 0;
Expand Down Expand Up @@ -1149,10 +1153,9 @@ static int vpe_release(struct inode *inode, struct file *filp)
if (ret < 0)
v->shared_ptr = NULL;

// cleanup any temp buffers
if (v->pbuffer)
vfree(v->pbuffer);
vfree(v->pbuffer);
v->plen = 0;

return ret;
}

Expand All @@ -1169,11 +1172,6 @@ static ssize_t vpe_write(struct file *file, const char __user * buffer,
if (v == NULL)
return -ENODEV;

if (v->pbuffer == NULL) {
printk(KERN_ERR "VPE loader: no buffer for program\n");
return -ENOMEM;
}

if ((count + v->len) > v->plen) {
printk(KERN_WARNING
"VPE loader: elf size too big. Perhaps strip uneeded symbols\n");
Expand Down

0 comments on commit 414b4ac

Please sign in to comment.