File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -318,7 +318,6 @@ static int samsung_keypad_probe(struct platform_device *pdev)
318318 struct resource * res ;
319319 struct input_dev * input_dev ;
320320 unsigned int row_shift ;
321- unsigned int keymap_size ;
322321 int error ;
323322
324323 pdata = dev_get_platdata (& pdev -> dev );
@@ -345,9 +344,10 @@ static int samsung_keypad_probe(struct platform_device *pdev)
345344 pdata -> cfg_gpio (pdata -> rows , pdata -> cols );
346345
347346 row_shift = get_count_order (pdata -> cols );
348- keymap_size = (pdata -> rows << row_shift ) * sizeof (keypad -> keycodes [0 ]);
349347
350- keypad = devm_kzalloc (& pdev -> dev , sizeof (* keypad ) + keymap_size ,
348+ keypad = devm_kzalloc (& pdev -> dev ,
349+ struct_size (keypad , keycodes ,
350+ pdata -> rows << row_shift ),
351351 GFP_KERNEL );
352352 if (!keypad )
353353 return - ENOMEM ;
You can’t perform that action at this time.
0 commit comments