Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp510144pxj; Thu, 3 Jun 2021 12:07:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwEj6ZBszrK48noYVvtBvW7I9+e+bbulEbAYBYyAL1WQuxPiLZplr/ix7PGrBgDo+4DZN4A X-Received: by 2002:a17:906:e2d3:: with SMTP id gr19mr718876ejb.525.1622747270375; Thu, 03 Jun 2021 12:07:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622747270; cv=none; d=google.com; s=arc-20160816; b=fhOtsySW3K1NkV6pW/HOi/0bM3e89XfzXHkD9elgWe62A8lZooCLh2oWz06BbTON6X PdeWq5CwV2UgG4QGtvteDSxAFmPyPFUa2379M3z56FDTLakIap05lhAA042AVii6MgKs uBet/H6ijbo7VPiDQY4SN58EFAofriLOUPQ1yc0DLtFkx++Z6RMriyhczVmPpH6nOi2k H42TDF0r1Bt2icsELWFERrNFE8RqOoP3NpaN/aWUA66+xP6Cj9gmnSzHdotM3SCK2Yio eX3REdQGt5+PbofY857NQXdDTmF3vyupb/ED35osvg53KNkNAB3BxV+8vgyhkrx5VKyI R4Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=JiZCJVW8pWyAhiCL0+LEgtWSwU7+O4men9t6LOP1aXI=; b=0djjM+RlkvCHXa/35b56+i2v2vGMEOLW/ZjWae9H82lJHTWAtDAFO5fv2UKP1v46Zt znHl14FIbNqUaHtrRDptGMP9TiMUTUM6J1HrVIw0x46+uEBEeubBjAhtg4ImUkSpz+P7 68ReDpcW1IJgw4IIFW+TaryWHlujHRCctJUgRJoZC4pmJh4+grjiILXDbFcWMsjpCMpR RiXf0luddr9S+aZBse0FgqGkU+vSxfqxSF/z8viErPo/wmP01WqrQ0KATV/bq1Ahq3rr P0RRfUfs4HK+M2ovKNutO7fL3O4lwIVRlJ+efTWth+WxQgqOUFeeHWphQ7nqbmmgqmC6 WmYw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lu6si2791998ejb.547.2021.06.03.12.07.26; Thu, 03 Jun 2021 12:07:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbhFCTGx (ORCPT + 99 others); Thu, 3 Jun 2021 15:06:53 -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-kernel@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