From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934177AbdKPLXs (ORCPT ); Thu, 16 Nov 2017 06:23:48 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:52422 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758863AbdKPLXm (ORCPT ); Thu, 16 Nov 2017 06:23:42 -0500 Subject: Re: [PATCH] regulator: tps65218: Add NULL test for devm_kzalloc call To: Axel Lin , Mark Brown CC: Liam Girdwood , References: <20171113125232.9672-1-axel.lin@ingics.com> From: Keerthy Message-ID: Date: Thu, 16 Nov 2017 16:53:36 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171113125232.9672-1-axel.lin@ingics.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Monday 13 November 2017 06:22 PM, Axel Lin wrote: > Signed-off-by: Axel Lin One line commit message would be better than blank commit message. Otherwise: Reviewed-by: Keerthy > --- > 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, ®ulators[i], >