Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp452026pxj; Thu, 3 Jun 2021 10:35:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzDqcrnLhlSCNZvxDgavJi9kGk3TUKdGmtWokbpRNuw2lfblWzTffRHeDLt7P2Iu98wuFJJ X-Received: by 2002:a17:906:a3cc:: with SMTP id ca12mr462810ejb.534.1622741742910; Thu, 03 Jun 2021 10:35:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622741742; cv=none; d=google.com; s=arc-20160816; b=KdZWuvmcNwndtdFNou43I9Cfnj8/7AI8jhZn3LS8EPgaDlnwAocUjQXq+tGLFPahTQ SNaDnswjZlLP6+GNQDyiL5dgw1/N89JdOV7oVdzhZcuLbi9A3vPvshD776mHCvUQSH46 yd6XP3y4DjHqHMVMj3aYe03NCmn/aoXvLtIZj7cgUGS380eh8qws1v5Bdk7BLoqM4Mq9 gF9qP73LmTVP3Mh4Va17K1A+lrYW8vh9HGvQKGOC8gB0/zi4A6YolipcSahjjGgtLtJK WyAebkyF+Lg+7qnThvLkHHz4uVIJM1sbqkGaNpVLG/kFvzg5nDd2OLWuL/ooZ7ZDH9QY I1LQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=EmyX0XyWEIneeDYfbBG4ObIuDu7DXUhUCt5AQSkJlag=; b=BsO8afy3aK2OlHpOt8NXlqz+Mq7b/t3VwcOZm5cWYmkvnnVuI60mXuBBKUk0Fhhwyy GlDgHnBlKF5pbHBBeWy95/G9iJ3AzQyyUMVAuXDRB4XSCEOYJ3ih3TRWvPm46JdYfBCS O8B3FnPCGzNzh+bdtQRDbAPCI3+3w3u24sDJ10u8AEg+zjOwNnrTOqMMZW4VwmYMngbG oddyn+3KnqKdYmvhvLbh6zlSsfnVl/gZWyBUJnFMMxtudKtNlu4CyFmJYByBSUbP3qV6 Z2hszdo+7WrnSqnBPFloJ1gLTm1A1ZAXKGcW4lcm5P/0j4jNdVHmPxdlcyNKbDj43LJf fQBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=n6E+ChRb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id os10si2681174ejb.60.2021.06.03.10.35.18; Thu, 03 Jun 2021 10:35:42 -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; dkim=pass header.i=@linaro.org header.s=google header.b=n6E+ChRb; 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=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229982AbhFCRdk (ORCPT + 99 others); Thu, 3 Jun 2021 13:33:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230265AbhFCRdj (ORCPT ); Thu, 3 Jun 2021 13:33:39 -0400 Received: from mail-qt1-x834.google.com (mail-qt1-x834.google.com [IPv6:2607:f8b0:4864:20::834]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B1DCC06174A for ; Thu, 3 Jun 2021 10:31:41 -0700 (PDT) Received: by mail-qt1-x834.google.com with SMTP id t20so4946000qtx.8 for ; Thu, 03 Jun 2021 10:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EmyX0XyWEIneeDYfbBG4ObIuDu7DXUhUCt5AQSkJlag=; b=n6E+ChRbvpZMpLyiN6668dyKckxes03IVA8NNi42tJcaWWUDIlporID7j9wH8rN6P5 lDaXi4omE+fI8G5EYtzEAt70d6smtPw5lbRx9Q6URvNl+5Ic+PnFS8FEPwvDTKgb5Del oQe/DMHD+DMUMjcpdVPk94WrJYfPc7jgMgjKUsSt2sBgtoJAmH0/7nEp1JUAFGXsNPeJ /YSqrQFzDveb2iab77/pjlp2JLF3G/VJJxq8DKzVei+bsVIEuHLyrCirzq8gPNgmbANr MLYNNig9nivfh8yqmVlzYav/hnP1LKy1WLQ2Q8qai5leMm5mZDQLqj5DO0xWvoif13ls 0lOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EmyX0XyWEIneeDYfbBG4ObIuDu7DXUhUCt5AQSkJlag=; b=ilFOrJ+YP4vTWvC9V9KBEgB6wJkvLcQU3U9epxgFjxU16rAYYBJKCWY0aAlNO4qb51 S4s0DsLBT71wprSR/uBEMaF2fXY/QW9QQqZX6vh6eEAb84MvbwQZCJiq1WvX432RPTJb aGV9H5XQpWmsU5Ush06Onq+3ns6+FqvBkWc8nUeeSPjKajlw0SV083u445XxMXTkqRGr fiOetJO74CgjEQepsniWeV7VXRHz/ZHDwGO6cFEGTijORiJIDGgRowNXgECig80ztQaM 6RTLELN9yfIqUxwKLwIma0BH3Q6a3Dw2uNN1+Lary2RD2kpNQ4WAwyzorXDRGfBmLt04 E0lg== X-Gm-Message-State: AOAM530+74C0Y9SnxslZpRemoEKf3YyJMYVxHwXWljMI2xQozW/lqU+g 6PJyNbAvVu2ohusPQEU22hjRVDHfSYpDCMdFR6IQ/A== X-Received: by 2002:ac8:470b:: with SMTP id f11mr535777qtp.273.1622741499724; Thu, 03 Jun 2021 10:31:39 -0700 (PDT) MIME-Version: 1.0 References: <20210603141357.572347-1-yangyingliang@huawei.com> <20210603171253.GA25742@codeaurora.org> In-Reply-To: <20210603171253.GA25742@codeaurora.org> From: Dmitry Baryshkov Date: Thu, 3 Jun 2021 20:31:28 +0300 Message-ID: Subject: Re: [PATCH -next] mfd: pm8008: Fix return value check in pm8008_probe() To: Guru Das Srinagesh Cc: Yang Yingliang , open list , "open list:DRM DRIVER FOR MSM ADRENO GPU" , Lee Jones , Andy Gross Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. > > > --- > > 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