Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1927913lqo; Sun, 19 May 2024 05:30:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWa00PfmLMgn06KFus4OYo2Ddno6NT/BwPtm551sib3Fhut+Vwaq5BBsmdw45OVmqAftOfou8hKoDVV2P3/EQbvpkHBPPTuuDZ7d9wSeQ== X-Google-Smtp-Source: AGHT+IG3FA6BvHiOY35zxK4yOS4QIlYxXTT3s+4ll3S++AwLbvaQlVGs6x1tjRdd4HTQ404NwCia X-Received: by 2002:a05:6a00:21c1:b0:6e6:ac71:8b38 with SMTP id d2e1a72fcca58-6f4e034858bmr26514628b3a.22.1716121804165; Sun, 19 May 2024 05:30:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716121804; cv=pass; d=google.com; s=arc-20160816; b=m8LZJlvwBtkpRS4RH2IAWHmBakowYwC/1eRJPHZjlG/Hob2Nl0XuvuakquENnIUbDQ 68WGbzDv08TB3T5UQZGaemnDDfRc2cWP9DfO3xkkvth9DQ3Bi+jqK3/AWZSnz+4X5YRn GOZkxWPerjWi+cJiebn9j5WhaYLyyLp3UmLFVhdsQ3dF2fabKgOPx+qnPz+Xb4PZjCT/ 8G7pAaWxi+yCWLGZVdXViMhxwBwEFKm+34FqbtNs+bPb55cuhhw+LiLiNeIoc0XnZSex mEQ6D/UTU+mPT2D9B9cSQ17ItxJ7tc35hiaFfFV3+1FCF5PoN1YycrvTx3fezCPrDs6i jhrw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=RgDlBl63zzrKCL2OQpQb/GEb1hQ6Pg0hdsVhjT3k0Is=; fh=TbwAf1M5EDQnklch0TqZ2ZF5K77wxpdLGsFwCwlcqnc=; b=ASFNGtDTCE/XLVmVsSWo+JeDCqoUB1DrULFkghTC34SEod+RcYcH1lOmiUe6xj83M3 AYwVHiUKY6Fkg1KHQEkGss3ujgVLVkKqze8eliM3BotOunqVzB0tAOHO3xu2hnOav8+k 1XJROhK5HLS0GnSCXnQOTZXzLKJ0jR96maXS3vDmovdiYjYt9FDe/vlP8HhkQVPJY59+ g2kCUvJyIsnAMJ6GG+gSRrK6lpJxkoo+qnt5ZWbs/j5Z/Sf8U8/YXWPmTRBJcCeEhvQq gLSuBdyR/lhl+3C6Xt3uqAYd+cbD3GRZWBOdpZb/tFUNA+btjCI+W4Xiz3C2qn7rAOgm 3dfQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oeoasi9G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b1bb4fsi18838316b3a.278.2024.05.19.05.30.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 05:30:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oeoasi9G; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-183101-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 4776C2815C0 for ; Sun, 19 May 2024 12:30:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9E4AA481AB; Sun, 19 May 2024 12:29:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="oeoasi9G" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3B6FC125; Sun, 19 May 2024 12:29:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716121792; cv=none; b=DPaEAs1pyJ11Uesf2wfyD0gpy155/wYt2N+e6FRmSsuD89RL/BypIPRlZhNzq4ZowziwG/LtWt/BJkqSGpiPR8QFNSpEpQoO8UWt5MXnGhGaDfPV7DTL8RzSg6ePkJyLbigB3ULazUmRU8ESE6krmsZp0oQo5RB7wUXcCxuT8nM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716121792; c=relaxed/simple; bh=XplS7g9XBR4slyRkjVfB4D5m11QQr+XO7LDsHyPJccQ=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RtC2LsTxVlebkCCc0Ksu7+1I7JTr4L2D/C9Jkc/024DoKBCk6rGIVCHfG8MaZwHy1u9PNbGqHUcAcPAwLiC+ODnhvyIZUfThzQSQz08tM1zRe1CKzx3MmUaP7iEZJ93TbZR8oGjqaoDgX5SSgaovyxCxjpbLG1TFt+3s9A2ru3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oeoasi9G; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id F3623C32781; Sun, 19 May 2024 12:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716121792; bh=XplS7g9XBR4slyRkjVfB4D5m11QQr+XO7LDsHyPJccQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oeoasi9G+h95P3n13yKFonnMBvrkfRLJEojWd0I0aW2gvkSYRZ/xtnjXRlv6I52TH lm25BO5PQp54fVUCziVfPDWWl78GhKanXihHIa8RHN58IuXybEew2raO8s31xSKyx2 gPJDCQyAQfarAVmmh+P/L4whCT1n+KS+gw6knzssyJNKjUFge+dxmc0uIxM3mDvtnN viIfjDJFbJYK/tTTup7DiPwdiHqtHy7/dnJ5Oud2B8weMZeogFmNLILqrDRewys4Oo sdve9HInAb6UNvsaimfh5R1aEAWZP8yQAlvH0FIaKRhF7oT5KByJkS+/gC65r1YAoZ B9P2zDlRZm1Qw== Date: Sun, 19 May 2024 13:29:40 +0100 From: Jonathan Cameron To: Harshit Mogalapalli Cc: Crt Mori , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com Subject: Re: [PATCH v2] iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe() Message-ID: <20240519132940.3714e57b@jic23-huawei> In-Reply-To: <20240513203427.3208696-1-harshit.m.mogalapalli@oracle.com> References: <20240513203427.3208696-1-harshit.m.mogalapalli@oracle.com> X-Mailer: Claws Mail 4.2.0 (GTK 3.24.42; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Mon, 13 May 2024 13:34:27 -0700 Harshit Mogalapalli wrote: > When devm_regmap_init_i2c() fails, regmap_ee could be error pointer, > instead of checking for IS_ERR(regmap_ee), regmap is checked which looks > like a copy paste error. > > Fixes: a1d1ba5e1c28 ("iio: temperature: mlx90635 MLX90635 IR Temperature sensor") > Signed-off-by: Harshit Mogalapalli Please make sure to pick up tags given on earlier versions. You dropped Crt's Reviewed-by without giving a reasons. I've put it back. Applied to the fixes-togreg branch of iio.git and marked for stable. I'll be rebasing that on rc1 once available. Until then it won't be visible. Thanks, Jonathan > --- > This is found using smatch, only compile tested. > v1->v2: Address Crt's comments. > --- > drivers/iio/temperature/mlx90635.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/iio/temperature/mlx90635.c b/drivers/iio/temperature/mlx90635.c > index 1f5c962c1818..f7f88498ba0e 100644 > --- a/drivers/iio/temperature/mlx90635.c > +++ b/drivers/iio/temperature/mlx90635.c > @@ -947,9 +947,9 @@ static int mlx90635_probe(struct i2c_client *client) > "failed to allocate regmap\n"); > > regmap_ee = devm_regmap_init_i2c(client, &mlx90635_regmap_ee); > - if (IS_ERR(regmap)) > - return dev_err_probe(&client->dev, PTR_ERR(regmap), > - "failed to allocate regmap\n"); > + if (IS_ERR(regmap_ee)) > + return dev_err_probe(&client->dev, PTR_ERR(regmap_ee), > + "failed to allocate EEPROM regmap\n"); > > mlx90635 = iio_priv(indio_dev); > i2c_set_clientdata(client, indio_dev);