mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-14 12:37:32 +00:00
clk: max77686: Fix return value checking for devm_kzalloc
devm_kzalloc returns NULL on failure. Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mike Turquette <mturquette@linaro.org>
This commit is contained in:
parent
bab53301c3
commit
9f58b9b9fe
1 changed files with 3 additions and 3 deletions
|
@ -132,7 +132,7 @@ static int max77686_clk_register(struct device *dev,
|
||||||
|
|
||||||
max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
|
max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup),
|
||||||
GFP_KERNEL);
|
GFP_KERNEL);
|
||||||
if (IS_ERR(max77686->lookup))
|
if (!max77686->lookup)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
max77686->lookup->con_id = hw->init->name;
|
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 = devm_kzalloc(&pdev->dev, sizeof(struct max77686_clk *)
|
||||||
* MAX77686_CLKS_NUM, GFP_KERNEL);
|
* MAX77686_CLKS_NUM, GFP_KERNEL);
|
||||||
if (IS_ERR(max77686_clks))
|
if (!max77686_clks)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
for (i = 0; i < MAX77686_CLKS_NUM; i++) {
|
for (i = 0; i < MAX77686_CLKS_NUM; i++) {
|
||||||
max77686_clks[i] = devm_kzalloc(&pdev->dev,
|
max77686_clks[i] = devm_kzalloc(&pdev->dev,
|
||||||
sizeof(struct max77686_clk), GFP_KERNEL);
|
sizeof(struct max77686_clk), GFP_KERNEL);
|
||||||
if (IS_ERR(max77686_clks[i]))
|
if (!max77686_clks[i])
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue