mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-06-05 22:31:36 +00:00
clk: fix clk_get_bulk when phandle error
This fixes the Coverity Defect CID 175347 when dev_count_phandle_with_args()
returns a negative value.
Fixes: a855be87da
("clk: Add get/enable/disable/release for a bulk of clocks")
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
parent
895a82ce90
commit
721881c417
1 changed files with 2 additions and 2 deletions
|
@ -111,8 +111,8 @@ int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk)
|
||||||
bulk->count = 0;
|
bulk->count = 0;
|
||||||
|
|
||||||
count = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
|
count = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
|
||||||
if (!count)
|
if (count < 1)
|
||||||
return 0;
|
return count;
|
||||||
|
|
||||||
bulk->clks = devm_kcalloc(dev, count, sizeof(struct clk), GFP_KERNEL);
|
bulk->clks = devm_kcalloc(dev, count, sizeof(struct clk), GFP_KERNEL);
|
||||||
if (!bulk->clks)
|
if (!bulk->clks)
|
||||||
|
|
Loading…
Add table
Reference in a new issue