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,
447447 struct mmp_clk_mix * mix ;
448448 struct clk * clk ;
449449 struct clk_init_data init ;
450- size_t table_bytes ;
451450
452451 mix = kzalloc (sizeof (* mix ), GFP_KERNEL );
453452 if (!mix )
@@ -461,18 +460,17 @@ struct clk *mmp_clk_register_mix(struct device *dev,
461460
462461 memcpy (& mix -> reg_info , & config -> reg_info , sizeof (config -> reg_info ));
463462 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 );
466465 if (!mix -> table )
467466 goto free_mix ;
468467
469468 mix -> table_size = config -> table_size ;
470469 }
471470
472471 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 );
476474 if (!mix -> mux_table ) {
477475 kfree (mix -> table );
478476 goto free_mix ;
You can’t perform that action at this time.
0 commit comments