lkml.org 
[lkml]   [2017]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] regulator: tps65218: Add NULL test for devm_kzalloc call
From
Date


On Monday 13 November 2017 06:22 PM, Axel Lin wrote:
> Signed-off-by: Axel Lin <axel.lin@ingics.com>

One line commit message would be better than blank commit message.
Otherwise:

Reviewed-by: Keerthy <j-keerthy@ti.com>

> ---
> drivers/regulator/tps65218-regulator.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/regulator/tps65218-regulator.c b/drivers/regulator/tps65218-regulator.c
> index bc489958fed7..b3f89ebfb1a0 100644
> --- a/drivers/regulator/tps65218-regulator.c
> +++ b/drivers/regulator/tps65218-regulator.c
> @@ -329,6 +329,8 @@ static int tps65218_regulator_probe(struct platform_device *pdev)
> /* Allocate memory for strobes */
> tps->strobes = devm_kzalloc(&pdev->dev, sizeof(u8) *
> TPS65218_NUM_REGULATOR, GFP_KERNEL);
> + if (!tps->strobes)
> + return -ENOMEM;
>
> for (i = 0; i < ARRAY_SIZE(regulators); i++) {
> rdev = devm_regulator_register(&pdev->dev, &regulators[i],
>
\
 
 \ /
  Last update: 2017-11-17 17:17    [W:0.854 / U:0.024 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site