Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 353909
b: refs/heads/master
c: 0902468
h: refs/heads/master
i:
  353907: dc043d9
v: v3
  • Loading branch information
Cong Ding authored and Greg Kroah-Hartman committed Jan 7, 2013
1 parent e1eff18 commit ca32bdd
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 14 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: 78855c7a7c3db183ddb311cd832a137ef7a5e83a
refs/heads/master: 0902468846460274018100bec29e2b236f70ab14
39 changes: 26 additions & 13 deletions trunk/drivers/staging/echo/echo.c
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ struct oslec_state *oslec_create(int len, int adaption_mode)
{
struct oslec_state *ec;
int i;
const int16_t *history;

ec = kzalloc(sizeof(*ec), GFP_KERNEL);
if (!ec)
Expand All @@ -238,15 +239,22 @@ struct oslec_state *oslec_create(int len, int adaption_mode)
ec->log2taps = top_bit(len);
ec->curr_pos = ec->taps - 1;

for (i = 0; i < 2; i++) {
ec->fir_taps16[i] =
kcalloc(ec->taps, sizeof(int16_t), GFP_KERNEL);
if (!ec->fir_taps16[i])
goto error_oom;
}
ec->fir_taps16[0] =
kcalloc(ec->taps, sizeof(int16_t), GFP_KERNEL);
if (!ec->fir_taps16[0])
goto error_oom_0;

ec->fir_taps16[1] =
kcalloc(ec->taps, sizeof(int16_t), GFP_KERNEL);
if (!ec->fir_taps16[1])
goto error_oom_1;

fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps);
fir16_create(&ec->fir_state_bg, ec->fir_taps16[1], ec->taps);
history = fir16_create(&ec->fir_state, ec->fir_taps16[0], ec->taps);
if (!history)
goto error_state;
history = fir16_create(&ec->fir_state_bg, ec->fir_taps16[1], ec->taps);
if (!history)
goto error_state_bg;

for (i = 0; i < 5; i++)
ec->xvtx[i] = ec->yvtx[i] = ec->xvrx[i] = ec->yvrx[i] = 0;
Expand All @@ -256,7 +264,7 @@ struct oslec_state *oslec_create(int len, int adaption_mode)

ec->snapshot = kcalloc(ec->taps, sizeof(int16_t), GFP_KERNEL);
if (!ec->snapshot)
goto error_oom;
goto error_snap;

ec->cond_met = 0;
ec->Pstates = 0;
Expand All @@ -269,10 +277,15 @@ struct oslec_state *oslec_create(int len, int adaption_mode)

return ec;

error_oom:
for (i = 0; i < 2; i++)
kfree(ec->fir_taps16[i]);

error_snap:
fir16_free(&ec->fir_state_bg);
error_state_bg:
fir16_free(&ec->fir_state);
error_state:
kfree(ec->fir_taps16[1]);
error_oom_1:
kfree(ec->fir_taps16[0]);
error_oom_0:
kfree(ec);
return NULL;
}
Expand Down

0 comments on commit ca32bdd

Please sign in to comment.