Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp721494pxj; Thu, 3 Jun 2021 18:30:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWnF+zMLCgryjO2bFs5KOlDZL1p3I5OFfsW/mEaTdd1KhEfElibe4SgMzIhYwzDLnFFObI X-Received: by 2002:aa7:d8d8:: with SMTP id k24mr2051659eds.253.1622770206701; Thu, 03 Jun 2021 18:30:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622770206; cv=none; d=google.com; s=arc-20160816; b=tJ45UGyGXbZcAj+RDJEUMv2MFwjN5srlRkJsdsjhqd0q7bUB97j41kH0yfYhoV41mU Cw2BKjWw9c6SxBiirQOSSQQkqR+cgLVIBiCbKjb+NJO0ak23VxukhP6aDP2grtNTyRaY dI9UwqaXaakFZ0oY6WvMpYmnPFXBRKz6NG9UPGOM9O+AbvJPJX1GDYf48U+tvLLCH5Ch VPs7ZthiLOmW3NvOHhJz+q2WlXgkTkiS5hsXDiEOBZqYJW1xxly4lz7heiPUHMBIxINM SgW0dOYcBZOhkXDZwSIrsXZwJr6CTOaGyt7/DxXFfuqK1OsbFyKv0Y8VfAhRUMhmYQrb NelQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=Exmx5pZ7yuMLw5f1asLzhxb7nQK942U9/alC6P6QNmg=; b=YX0L1O7RBiRchOM2+OciBxaKL4OwELNL/F5rKeqbOmv1+s+QLiz/7hn47FjbxfqGWU byKz6Wwoju4PetjD9wHgmHuAUZ+xz31p5eNA2OcUnCdgwm9y+Y300FnizEFFjcQfUZ/R 5fOijtW11H2Dyg037S06JuKA/nNsjLOKCWph+2PF4nuy/7id20GsfZyMbcq9SlC9Qb/R UfOGfo+S57yry4JUblf1XJMoTgdNqmu3hZbcUvJ+pXcFnAajo4UwReIYe1qzL4gq+Lm6 l/eupX1RKHa+1RdFmtnN0JfCuFAL+Z2cJD3O8M6rin1Vb+eNxMNHx7IP5y749CLRkFrd n0bg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n1si3331091ejx.353.2021.06.03.18.29.42; Thu, 03 Jun 2021 18:30:06 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229772AbhFDB1w (ORCPT + 99 others); Thu, 3 Jun 2021 21:27:52 -0400 Received: from szxga02-in.huawei.com ([45.249.212.188]:3416 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229685AbhFDB1w (ORCPT ); Thu, 3 Jun 2021 21:27:52 -0400 Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4Fx4lC65C2z6v8r; Fri, 4 Jun 2021 09:23:03 +0800 (CST) Received: from dggpeml500017.china.huawei.com (7.185.36.243) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 09:26:03 +0800 Received: from [10.174.178.174] (10.174.178.174) by dggpeml500017.china.huawei.com (7.185.36.243) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.2; Fri, 4 Jun 2021 09:26:02 +0800 Subject: Re: [PATCH -next] mfd: pm8008: Fix return value check in pm8008_probe() To: Guru Das Srinagesh , Dmitry Baryshkov CC: open list , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Lee Jones , Andy Gross References: <20210603141357.572347-1-yangyingliang@huawei.com> <20210603171253.GA25742@codeaurora.org> <20210603190506.GA24042@codeaurora.org> From: Yang Yingliang Message-ID: Date: Fri, 4 Jun 2021 09:26:01 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20210603190506.GA24042@codeaurora.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.174.178.174] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500017.china.huawei.com (7.185.36.243) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/6/4 3:05, Guru Das Srinagesh wrote: > 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. My bad, I sent a wong patch, I will send a new one. Thanks, Yang > 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 > .