From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DC01AC47096 for ; Thu, 3 Jun 2021 19:05:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A9AB3613DE for ; Thu, 3 Jun 2021 19:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229640AbhFCTGw (ORCPT ); Thu, 3 Jun 2021 15:06:52 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:55701 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCTGw (ORCPT ); Thu, 3 Jun 2021 15:06:52 -0400 Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-02.qualcomm.com with ESMTP; 03 Jun 2021 12:05:07 -0700 X-QCInternal: smtphost Received: from gurus-linux.qualcomm.com ([10.134.64.25]) by ironmsg04-sd.qualcomm.com with ESMTP; 03 Jun 2021 12:05:06 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 4E79D20FC9; Thu, 3 Jun 2021 12:05:06 -0700 (PDT) Date: Thu, 3 Jun 2021 12:05:06 -0700 From: Guru Das Srinagesh To: Dmitry Baryshkov Cc: Yang Yingliang , open list , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Lee Jones , Andy Gross Subject: Re: [PATCH -next] mfd: pm8008: Fix return value check in pm8008_probe() Message-ID: <20210603190506.GA24042@codeaurora.org> References: <20210603141357.572347-1-yangyingliang@huawei.com> <20210603171253.GA25742@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org On Thu, Jun 03, 2021 at 08:31:28PM +0300, Dmitry Baryshkov wrote: > On Thu, 3 Jun 2021 at 20:18, Guru Das Srinagesh wrote: > > > > On Thu, Jun 03, 2021 at 10:13:57PM +0800, Yang Yingliang wrote: > > > In case of error, the function devm_regmap_init_i2c() returns ERR_PTR() > > > and never returns NULL. The NULL test in the return value check > > > should be replaced with IS_ERR(). > > > > > > Fixes: 6b149f3310a4 ("mfd: pm8008: Add driver for QCOM PM8008 PMIC") > > > Reported-by: Hulk Robot > > > Signed-off-by: Yang Yingliang > > > > Acked-by: Guru Das Srinagesh > > Interestingly, the change does not correspond to the changelog > message. And the code is correct as devm_kzalloc returns NULL if I > remember correctly. Thanks for pointing that out - I missed that. I would like to retract my Acked-by for this patch. > > > > > > --- > > > drivers/mfd/qcom-pm8008.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/mfd/qcom-pm8008.c b/drivers/mfd/qcom-pm8008.c > > > index c472d7f8103c..dfefa60d693b 100644 > > > --- a/drivers/mfd/qcom-pm8008.c > > > +++ b/drivers/mfd/qcom-pm8008.c > > > @@ -223,7 +223,7 @@ static int pm8008_probe(struct i2c_client *client) > > > struct pm8008_data *chip; > > > > > > chip = devm_kzalloc(&client->dev, sizeof(*chip), GFP_KERNEL); > > > - if (!chip) > > > + if (IS_ERR(chip)) > > > return -ENOMEM; > > > > > > chip->dev = &client->dev; > > > -- > > > 2.25.1 > > > > > > > -- > With best wishes > Dmitry