drivers/clk/mediatek: 4 more suspected missing null check for return pointer of mtk_alloc_clk_data

From: YE Chengfeng
Date: Tue Oct 26 2021 - 03:32:59 EST


Hi,

These are 4 more missing null check for the return pointer of mtk_alloc_clk_data found by our static analysis tool. We manually check them and we think they are true problem. Would you like to have a look at them?

https://github.com/torvalds/linux/blob/master/drivers/clk/mediatek/clk-mt8135.c#L528
Missing null check at #line 528, potential null-pointer-dereference at #line 535.

https://github.com/torvalds/linux/blob/master/drivers/clk/mediatek/clk-mt8135.c#L549
Missing null check at #line 549, potential null-pointer-dereference at #line 554

https://github.com/torvalds/linux/blob/master/drivers/clk/mediatek/clk-mt7629.c#L605
Missing null check at #line 605, potential null-pointer-dereference at #line 610 (mtk_clk_register_cpumuxes will dereference the pointer clk_data)

https://github.com/torvalds/linux/blob/master/drivers/clk/mediatek/clk-mt7629.c#L582
Missing null check at #line 582, potential null-pointer-dereference at #line 593

Thanks so much,
Chengfeng