diff options
author | Axel Lin <axel.lin@ingics.com> | 2012-12-18 02:43:45 -0500 |
---|---|---|
committer | Mike Turquette <mturquette@linaro.org> | 2013-01-11 21:55:36 -0500 |
commit | 9f58b9b9fe3646421d9de251a4c5eec6d299a395 (patch) | |
tree | 6f5567abbc780d5eedbc10e2bf89558e6ccff38a /drivers/clk/clk-max77686.c | |
parent | bab53301c3846ae9a5e1142dca2976f434f70481 (diff) |
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>
Diffstat (limited to 'drivers/clk/clk-max77686.c')
-rw-r--r-- | drivers/clk/clk-max77686.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c index d098f72e1d5f..894421417000 100644 --- a/drivers/clk/clk-max77686.c +++ b/drivers/clk/clk-max77686.c | |||
@@ -132,7 +132,7 @@ static int max77686_clk_register(struct device *dev, | |||
132 | 132 | ||
133 | max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup), | 133 | max77686->lookup = devm_kzalloc(dev, sizeof(struct clk_lookup), |
134 | GFP_KERNEL); | 134 | GFP_KERNEL); |
135 | if (IS_ERR(max77686->lookup)) | 135 | if (!max77686->lookup) |
136 | return -ENOMEM; | 136 | return -ENOMEM; |
137 | 137 | ||
138 | max77686->lookup->con_id = hw->init->name; | 138 | max77686->lookup->con_id = hw->init->name; |
@@ -151,13 +151,13 @@ static int max77686_clk_probe(struct platform_device *pdev) | |||
151 | 151 | ||
152 | max77686_clks = devm_kzalloc(&pdev->dev, sizeof(struct max77686_clk *) | 152 | max77686_clks = devm_kzalloc(&pdev->dev, sizeof(struct max77686_clk *) |
153 | * MAX77686_CLKS_NUM, GFP_KERNEL); | 153 | * MAX77686_CLKS_NUM, GFP_KERNEL); |
154 | if (IS_ERR(max77686_clks)) | 154 | if (!max77686_clks) |
155 | return -ENOMEM; | 155 | return -ENOMEM; |
156 | 156 | ||
157 | for (i = 0; i < MAX77686_CLKS_NUM; i++) { | 157 | for (i = 0; i < MAX77686_CLKS_NUM; i++) { |
158 | max77686_clks[i] = devm_kzalloc(&pdev->dev, | 158 | max77686_clks[i] = devm_kzalloc(&pdev->dev, |
159 | sizeof(struct max77686_clk), GFP_KERNEL); | 159 | sizeof(struct max77686_clk), GFP_KERNEL); |
160 | if (IS_ERR(max77686_clks[i])) | 160 | if (!max77686_clks[i]) |
161 | return -ENOMEM; | 161 | return -ENOMEM; |
162 | } | 162 | } |
163 | 163 | ||