linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] clk: max77686: Fix return value checking for devm_kzalloc
@ 2012-12-18  7:43 Axel Lin
  2013-01-12  2:56 ` Mike Turquette
  0 siblings, 1 reply; 2+ messages in thread
From: Axel Lin @ 2012-12-18  7:43 UTC (permalink / raw)
  To: linux-arm-kernel

devm_kzalloc returns NULL on failure.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
 drivers/clk/clk-max77686.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
index d098f72..8944214 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,
 
 	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;
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] clk: max77686: Fix return value checking for devm_kzalloc
  2012-12-18  7:43 [PATCH] clk: max77686: Fix return value checking for devm_kzalloc Axel Lin
@ 2013-01-12  2:56 ` Mike Turquette
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Turquette @ 2013-01-12  2:56 UTC (permalink / raw)
  To: linux-arm-kernel

Quoting Axel Lin (2012-12-17 23:43:45)
> devm_kzalloc returns NULL on failure.
> 
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

Pulled into clk-next.

Thanks for the patch,
Mike

> ---
>  drivers/clk/clk-max77686.c |    6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/clk/clk-max77686.c b/drivers/clk/clk-max77686.c
> index d098f72..8944214 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,
>  
>         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;
>         }
>  
> -- 
> 1.7.9.5

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2013-01-12  2:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-18  7:43 [PATCH] clk: max77686: Fix return value checking for devm_kzalloc Axel Lin
2013-01-12  2:56 ` Mike Turquette

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).