File tree Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Expand file tree Collapse file tree 1 file changed +4
-6
lines changed Original file line number Diff line number Diff line change @@ -447,7 +447,6 @@ struct clk *mmp_clk_register_mix(struct device *dev,
447
447
struct mmp_clk_mix * mix ;
448
448
struct clk * clk ;
449
449
struct clk_init_data init ;
450
- size_t table_bytes ;
451
450
452
451
mix = kzalloc (sizeof (* mix ), GFP_KERNEL );
453
452
if (!mix )
@@ -461,18 +460,17 @@ struct clk *mmp_clk_register_mix(struct device *dev,
461
460
462
461
memcpy (& mix -> reg_info , & config -> reg_info , sizeof (config -> reg_info ));
463
462
if (config -> table ) {
464
- table_bytes = sizeof ( * config -> table ) * config -> table_size ;
465
- mix -> table = kmemdup ( config -> table , table_bytes , GFP_KERNEL );
463
+ mix -> table = kmemdup_array ( config -> table , config -> table_size ,
464
+ sizeof ( * mix -> table ) , GFP_KERNEL );
466
465
if (!mix -> table )
467
466
goto free_mix ;
468
467
469
468
mix -> table_size = config -> table_size ;
470
469
}
471
470
472
471
if (config -> mux_table ) {
473
- table_bytes = sizeof (u32 ) * num_parents ;
474
- mix -> mux_table = kmemdup (config -> mux_table , table_bytes ,
475
- GFP_KERNEL );
472
+ mix -> mux_table = kmemdup_array (config -> mux_table , num_parents ,
473
+ sizeof (* mix -> mux_table ), GFP_KERNEL );
476
474
if (!mix -> mux_table ) {
477
475
kfree (mix -> table );
478
476
goto free_mix ;
You can’t perform that action at this time.
0 commit comments