clk: ti: dra7-atl: don't allocate `parent_names' variable
authorDario Binacchi <dario.binacchi@amarulasolutions.com>
Sun, 13 Nov 2022 18:11:47 +0000 (19:11 +0100)
committerStephen Boyd <sboyd@kernel.org>
Wed, 23 Nov 2022 01:02:03 +0000 (17:02 -0800)
commit6e49aacaaf4a1380ba4d3cb4a22923193f5fdf40
tree46681f8f862445adcba7c768a0d85959237f0533
parent3400d546a741a2b2001d88e7fa29110d45a3930d
clk: ti: dra7-atl: don't allocate `parent_names' variable

The `parent_names' variable was freed also in case of kzalloc() error.
Instead of modifying the code to perform a proper memory release, I
decided to fix the bug by not allocating memory.
Since only one parent name is referenced, it is not necessary to
allocate this variable at runtime and therefore you can avoid calling
the kzalloc() function. This simplifies the code (even calls to kfree
can be removed) and improves the performance of the routine.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/r/20221113181147.1626585-2-dario.binacchi@amarulasolutions.com
Tested-by: Tony Lindgren <tony@atomide.com>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
drivers/clk/ti/clk-dra7-atl.c