Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259558
b: refs/heads/master
c: c0777d2
h: refs/heads/master
v: v3
  • Loading branch information
Peter Huewe authored and Greg Kroah-Hartman committed Jun 28, 2011
1 parent ed553b7 commit c610fb2
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 13 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: 8ded351ad1889e5351f29b3b1b1716c4992856ee
refs/heads/master: c0777d228892f6a6f87f3439a030d52406f8d637
33 changes: 21 additions & 12 deletions trunk/drivers/staging/altera-stapl/altera.c
Original file line number Diff line number Diff line change
Expand Up @@ -2430,16 +2430,23 @@ int altera_init(struct altera_config *config, const struct firmware *fw)
int index = 0;
s32 offset = 0L;
s32 error_address = 0L;
int retval = 0;

key = kzalloc(33 * sizeof(char), GFP_KERNEL);
if (!key)
return -ENOMEM;
value = kzalloc(257 * sizeof(char), GFP_KERNEL);
if (!value)
return -ENOMEM;
key = kzalloc(33, GFP_KERNEL);
if (!key) {
retval = -ENOMEM;
goto out;
}
value = kzalloc(257, GFP_KERNEL);
if (!value) {
retval = -ENOMEM;
goto free_key;
}
astate = kzalloc(sizeof(struct altera_state), GFP_KERNEL);
if (!astate)
return -ENOMEM;
if (!astate) {
retval = -ENOMEM;
goto free_value;
}

astate->config = config;
if (!astate->config->jtag_io) {
Expand Down Expand Up @@ -2518,10 +2525,12 @@ int altera_init(struct altera_config *config, const struct firmware *fw)
} else if (exec_result)
printk(KERN_ERR "%s: error %d\n", __func__, exec_result);

kfree(key);
kfree(value);
kfree(astate);

return 0;
free_value:
kfree(value);
free_key:
kfree(key);
out:
return retval;
}
EXPORT_SYMBOL(altera_init);

0 comments on commit c610fb2

Please sign in to comment.