提交 9f58b9b9 编写于 作者: A Axel Lin 提交者: Mike Turquette

clk: max77686: Fix return value checking for devm_kzalloc

devm_kzalloc returns NULL on failure.
Signed-off-by: NAxel Lin <axel.lin@ingics.com>
Signed-off-by: NMike Turquette <mturquette@linaro.org>
上级 bab53301
......@@ -132,7 +132,7 @@ static int max77686_clk_register(struct device *dev,
max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
GFP_KERNEL);
if (IS_ERR(max77686->lookup))
if (!max77686->lookup)
return -ENOMEM;
max77686->lookup->con_id = hw->init->name;
......@@ -151,13 +151,13 @@ static int max77686_clk_probe(struct platform_device *pdev)
max77686_clks = devm_kzalloc(&pdev->dev, sizeof(struct max77686_clk *)
* MAX77686_CLKS_NUM, GFP_KERNEL);
if (IS_ERR(max77686_clks))
if (!max77686_clks)
return -ENOMEM;
for (i = 0; i < MAX77686_CLKS_NUM; i++) {
max77686_clks[i] = devm_kzalloc(&pdev->dev,
sizeof(struct max77686_clk), GFP_KERNEL);
if (IS_ERR(max77686_clks[i]))
if (!max77686_clks[i])
return -ENOMEM;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册