Commit ec4c6675 authored by Omar Ramirez Luna's avatar Omar Ramirez Luna Committed by Greg Kroah-Hartman

staging: tidspbridge: dynamically allocate my_sym_buf in dload_symbols

Dynamically allocate my_sym_buf to silence the following warning:

drivers/staging/tidspbridge/dynload/cload.c:
    In function 'dload_symbols':
drivers/staging/tidspbridge/dynload/cload.c:890:
    warning: the frame size of 1040 bytes is larger than 1024 bytes
Signed-off-by: default avatarOmar Ramirez Luna <omar.ramirez@copitl.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a2fa68fd
...@@ -708,6 +708,7 @@ static void dload_symbols(struct dload_state *dlthis) ...@@ -708,6 +708,7 @@ static void dload_symbols(struct dload_state *dlthis)
struct local_symbol *sp; struct local_symbol *sp;
struct dynload_symbol *symp; struct dynload_symbol *symp;
struct dynload_symbol *newsym; struct dynload_symbol *newsym;
struct doff_syment_t *my_sym_buf;
sym_count = dlthis->dfile_hdr.df_no_syms; sym_count = dlthis->dfile_hdr.df_no_syms;
if (sym_count == 0) if (sym_count == 0)
...@@ -741,13 +742,18 @@ static void dload_symbols(struct dload_state *dlthis) ...@@ -741,13 +742,18 @@ static void dload_symbols(struct dload_state *dlthis)
become defined from the global symbol table */ become defined from the global symbol table */
checks = dlthis->verify.dv_sym_tab_checksum; checks = dlthis->verify.dv_sym_tab_checksum;
symbols_left = sym_count; 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 */ do { /* read all symbols */
char *sname; char *sname;
u32 val; u32 val;
s32 delta; s32 delta;
struct doff_syment_t *input_sym; struct doff_syment_t *input_sym;
unsigned syms_in_buf; unsigned syms_in_buf;
struct doff_syment_t my_sym_buf[MY_SYM_BUF_SIZ];
input_sym = my_sym_buf; input_sym = my_sym_buf;
syms_in_buf = symbols_left > MY_SYM_BUF_SIZ ? syms_in_buf = symbols_left > MY_SYM_BUF_SIZ ?
MY_SYM_BUF_SIZ : symbols_left; MY_SYM_BUF_SIZ : symbols_left;
...@@ -755,7 +761,7 @@ static void dload_symbols(struct dload_state *dlthis) ...@@ -755,7 +761,7 @@ static void dload_symbols(struct dload_state *dlthis)
if (dlthis->strm->read_buffer(dlthis->strm, input_sym, siz) != if (dlthis->strm->read_buffer(dlthis->strm, input_sym, siz) !=
siz) { siz) {
DL_ERROR(readstrm, sym_errid); DL_ERROR(readstrm, sym_errid);
return; goto free_sym_buf;
} }
if (dlthis->reorder_map) if (dlthis->reorder_map)
dload_reorder(input_sym, siz, dlthis->reorder_map); dload_reorder(input_sym, siz, dlthis->reorder_map);
...@@ -858,7 +864,7 @@ static void dload_symbols(struct dload_state *dlthis) ...@@ -858,7 +864,7 @@ static void dload_symbols(struct dload_state *dlthis)
DL_ERROR("Absolute symbol %s is " DL_ERROR("Absolute symbol %s is "
"defined multiple times with " "defined multiple times with "
"different values", sname); "different values", sname);
return; goto free_sym_buf;
} }
} }
loop_itr: loop_itr:
...@@ -889,6 +895,9 @@ static void dload_symbols(struct dload_state *dlthis) ...@@ -889,6 +895,9 @@ static void dload_symbols(struct dload_state *dlthis)
if (~checks) if (~checks)
dload_error(dlthis, "Checksum of symbols failed"); dload_error(dlthis, "Checksum of symbols failed");
free_sym_buf:
kfree(my_sym_buf);
return;
} /* dload_symbols */ } /* dload_symbols */
/***************************************************************************** /*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment