Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 317754
b: refs/heads/master
c: ec4c667
h: refs/heads/master
v: v3
  • Loading branch information
Omar Ramirez Luna authored and Greg Kroah-Hartman committed Jul 6, 2012
1 parent a1afa68 commit 4a5f2c6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 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: a2fa68fd769647b114829ba2a198a062cdb1c686
refs/heads/master: ec4c6675230402384976d34d38e2b828be6ad0d9
15 changes: 12 additions & 3 deletions trunk/drivers/staging/tidspbridge/dynload/cload.c
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,7 @@ static void dload_symbols(struct dload_state *dlthis)
struct local_symbol *sp;
struct dynload_symbol *symp;
struct dynload_symbol *newsym;
struct doff_syment_t *my_sym_buf;

sym_count = dlthis->dfile_hdr.df_no_syms;
if (sym_count == 0)
Expand Down Expand Up @@ -741,21 +742,26 @@ static void dload_symbols(struct dload_state *dlthis)
become defined from the global symbol table */
checks = dlthis->verify.dv_sym_tab_checksum;
symbols_left = sym_count;

my_sym_buf = kzalloc(sizeof(*my_sym_buf) * MY_SYM_BUF_SIZ, GFP_KERNEL);
if (!my_sym_buf)
return;

do { /* read all symbols */
char *sname;
u32 val;
s32 delta;
struct doff_syment_t *input_sym;
unsigned syms_in_buf;
struct doff_syment_t my_sym_buf[MY_SYM_BUF_SIZ];

input_sym = my_sym_buf;
syms_in_buf = symbols_left > MY_SYM_BUF_SIZ ?
MY_SYM_BUF_SIZ : symbols_left;
siz = syms_in_buf * sizeof(struct doff_syment_t);
if (dlthis->strm->read_buffer(dlthis->strm, input_sym, siz) !=
siz) {
DL_ERROR(readstrm, sym_errid);
return;
goto free_sym_buf;
}
if (dlthis->reorder_map)
dload_reorder(input_sym, siz, dlthis->reorder_map);
Expand Down Expand Up @@ -858,7 +864,7 @@ static void dload_symbols(struct dload_state *dlthis)
DL_ERROR("Absolute symbol %s is "
"defined multiple times with "
"different values", sname);
return;
goto free_sym_buf;
}
}
loop_itr:
Expand Down Expand Up @@ -889,6 +895,9 @@ static void dload_symbols(struct dload_state *dlthis)
if (~checks)
dload_error(dlthis, "Checksum of symbols failed");

free_sym_buf:
kfree(my_sym_buf);
return;
} /* dload_symbols */

/*****************************************************************************
Expand Down

0 comments on commit 4a5f2c6

Please sign in to comment.