Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp441213pxj; Thu, 3 Jun 2021 10:20:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzC9+5r+oUX8TB1/gYmRjN2D6QFlnAT3JbQR71KQ9DHLlun8cbaJCOo/alTGDaxMaTSfc3B X-Received: by 2002:a17:906:33c8:: with SMTP id w8mr449669eja.46.1622740808561; Thu, 03 Jun 2021 10:20:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622740808; cv=none; d=google.com; s=arc-20160816; b=DAXrfvFAMMc6gFUQSzSJ7EsdLVY4oksO7CV0irzo0hfkD2hn5yZtl7pF+8WE37Oy3b iKpGqQl77sHfnPcwcIsqSgCR3/ZfIlFEogtBcB1xkyfqIM5kxIxHq5rDfXbSWAf7AWjx gjEa2GSO5NEI60ZgZrm9/Dixa8Nu0XXlRz0ClsGI4vSsJlM6xLdv4H+bizHWIHHrWmRC RB1v53spb+5RARLbWgZq2f9dZYtzmpaMihpdXRNEG1WnJGkeYrfzB5qxW5DmPJK+0Xj0 HuawpxD9hZEwUAzH9z4QXof0bAz4zWeYmvas1JQMqOSm6kpZg2remuU2IsUK01iJhWzL QdIg== 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=N+y2MVpNBjZB83jrUswtLv4cKgFWgvMznFJprZTvmB8=; b=GRS0M87QqFX5SDnI1hWaEdTjnPjUq/zejezqRxDGskGS5ma0YrmQEVWPF01+j06I6R jlnywY7TYGKhNphEwOQVp7uP5lUF6S8YRwI0MLs85csFjHJzbLiq+zCt/+Z33bcmCMm9 WVwdLsNEuxJchAtQuGXirKKsQxJvwTsfuRzpxEHKuDNZrEFExkeAXJ4rR6J1CPmfW2dj QIaDKElm/uM8VfhZYotcywAWat5cdcYvnPKaYN/ojehZ1VF4PQ+F5EOrn4i8xcbH97sU 43h77i3QiVZIj0sXi7PSEkcL3l4lroI/rBBCRDoVyDb4tWRR4UIkYY+SBFBncKwhN0LR vjVw== 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 n1si2664780eja.710.2021.06.03.10.19.45; Thu, 03 Jun 2021 10:20:08 -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 S233020AbhFCRUi (ORCPT + 99 others); Thu, 3 Jun 2021 13:20:38 -0400 Received: from alexa-out-sd-02.qualcomm.com ([199.106.114.39]:64397 "EHLO alexa-out-sd-02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232814AbhFCRTA (ORCPT ); Thu, 3 Jun 2021 13:19:00 -0400 Received: from unknown (HELO ironmsg01-sd.qualcomm.com) ([10.53.140.141]) by alexa-out-sd-02.qualcomm.com with ESMTP; 03 Jun 2021 10:12:54 -0700 X-QCInternal: smtphost Received: from gurus-linux.qualcomm.com ([10.134.64.25]) by ironmsg01-sd.qualcomm.com with ESMTP; 03 Jun 2021 10:12:54 -0700 Received: by gurus-linux.qualcomm.com (Postfix, from userid 383780) id 1ECC9210E0; Thu, 3 Jun 2021 10:12:54 -0700 (PDT) Date: Thu, 3 Jun 2021 10:12:53 -0700 From: Guru Das Srinagesh To: Yang Yingliang Cc: linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, lee.jones@linaro.org, agross@kernel.org Subject: Re: [PATCH -next] mfd: pm8008: Fix return value check in pm8008_probe() Message-ID: <20210603171253.GA25742@codeaurora.org> References: <20210603141357.572347-1-yangyingliang@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210603141357.572347-1-yangyingliang@huawei.com> 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 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 > --- > 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 >