提交 721881c4 编写于 作者: N Neil Armstrong 提交者: Tom Rini

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: a855be87 ("clk: Add get/enable/disable/release for a bulk of clocks")
Signed-off-by: NNeil Armstrong <narmstrong@baylibre.com>
上级 895a82ce
......@@ -111,8 +111,8 @@ int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk)
bulk->count = 0;
count = dev_count_phandle_with_args(dev, "clocks", "#clock-cells");
if (!count)
return 0;
if (count < 1)
return count;
bulk->clks = devm_kcalloc(dev, count, sizeof(struct clk), GFP_KERNEL);
if (!bulk->clks)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册