File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -393,7 +393,7 @@ static void write_src(void)
393393{
394394 unsigned int i , k , off ;
395395 unsigned int best_idx [256 ];
396- unsigned int * markers ;
396+ unsigned int * markers , markers_cnt ;
397397 char buf [KSYM_NAME_LEN ];
398398
399399 printf ("#include <asm/bitsperlong.h>\n" );
@@ -413,7 +413,8 @@ static void write_src(void)
413413
414414 /* table of offset markers, that give the offset in the compressed stream
415415 * every 256 symbols */
416- markers = malloc (sizeof (unsigned int ) * ((table_cnt + 255 ) / 256 ));
416+ markers_cnt = (table_cnt + 255 ) / 256 ;
417+ markers = malloc (sizeof (* markers ) * markers_cnt );
417418 if (!markers ) {
418419 fprintf (stderr , "kallsyms failure: "
419420 "unable to allocate required memory\n" );
@@ -469,7 +470,7 @@ static void write_src(void)
469470 }
470471
471472 output_label ("kallsyms_markers" );
472- for (i = 0 ; i < (( table_cnt + 255 ) >> 8 ) ; i ++ )
473+ for (i = 0 ; i < markers_cnt ; i ++ )
473474 printf ("\t.long\t%u\n" , markers [i ]);
474475 printf ("\n" );
475476
You can’t perform that action at this time.
0 commit comments