Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp2287876lqo; Mon, 13 May 2024 13:36:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWZ9AS7pDPHFHxWwL8ZynA2oRh0G0P+36xS5bLlFkvxuT399IzX+3cuGtjmcmm3F8oobdrlXeXPPqZtabD0XP/fd7r27gCpXNPpwIh1Zw== X-Google-Smtp-Source: AGHT+IEaL4NaB/A1o4enI6B1lFee3m+yDMcEQI3byhNvOaAzsZTkb/lrp+WjO5+MWPeE19R3QP/3 X-Received: by 2002:a17:90a:ce8f:b0:2b3:5809:79d7 with SMTP id 98e67ed59e1d1-2b6cc758cbcmr8025904a91.28.1715632566432; Mon, 13 May 2024 13:36:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715632566; cv=pass; d=google.com; s=arc-20160816; b=oJ8BBY/MCaMnHW5E06wnK7X1ThMXoeWTqfMwc0DHooDxc7QcdpKDPJxOnVIKz9m0cB YIBMpvGdkPb2k8IoD73y2QtaDNri4y7DFqcBsRIN7S1YWBLnI0WMLQHK0gb4GtdA3lTA AP3tWUoDwKUigHtZr0xgIVsYdHhOTjvTgc/a6WTV1CRlGfX9x1MMwNa5Mx1qGGQ32uUd B3nanifdgDAPOrqza+D+gNdyWjW/F6mN3VjFFRMWwLz4AGunfI6I8S+D2ZtBIJGC7VDM W+R9/D2K/vSMS9jL0x65SJPyj6AeDMOkVI43O5Ynn+G2Td/JQS7UeigdDSqcpQoJW5ZI tGew== 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:message-id:date:subject:cc:to :from:dkim-signature; bh=JSbc/8eA5xrI1SaFPGINdQ50BsHMllxXcq2iZ5yctfw=; fh=KDJKBt/D1GPzurltLY23fDpOdXfZfAFOPqAvRWNi4Fw=; b=h/CiwN1CvFQkEOUXRBnLb8pAtowMBxFEaToHESr9KnoPBtt80g+XiYmaKulGUGjClN e8CyLb9XXMLbOruzcib8MJ7Bw9tT/K+B9ev6a8EaUJJ8oCAMqDUvySOS9dy8PPbBbI+v ETpYT7zFHJgPR+32chYZKa2cMrPMlKZaQq8upVwyEQSQzn7rxad0w9BVwfAUgnZkmsCg FAeQ7UXl1i+Wpg/ePJgSJOSzGiae1vb7MIOgmZ/o/aQCgvZun+9VN2VAGoG9jBwsaA5N 05c0Fdw7w2DsUQxXs5BVLS/GpVOVwYHv9kqzTfOyKR53G8+p4BvNOUe1CEbZnx1iradu SP8w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=Vqyxiqow; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-178072-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178072-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 98e67ed59e1d1-2b62886874fsi11991211a91.36.2024.05.13.13.36.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 May 2024 13:36:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-178072-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=@oracle.com header.s=corp-2023-11-20 header.b=Vqyxiqow; arc=pass (i=1 spf=pass spfdomain=oracle.com dkim=pass dkdomain=oracle.com dmarc=pass fromdomain=oracle.com); spf=pass (google.com: domain of linux-kernel+bounces-178072-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-178072-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=oracle.com 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 52310282422 for ; Mon, 13 May 2024 20:35:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87A6B8004B; Mon, 13 May 2024 20:34:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="Vqyxiqow" Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) (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 2A4E51E4B3; Mon, 13 May 2024 20:34:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.165.32 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715632491; cv=none; b=QkTYjqutwF8e2QncthXkfN/3vxZMsxk+0cPadCwmx4tvKeJdq+4GYcGhnrsm77pywgeO/dFhVPjIfbPjDyIvGMten+Zu5FDzFdaiS5pgGuZhk41Lk2UAvHrnnLoWxjOQnHt4griC7Y6BXreKoMZzTggeOXyw1DvrrBk08fFhDyg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715632491; c=relaxed/simple; bh=1FYaTNZmbmetPdDToWbnMaxuvHyPdQkR6OVxNbKy0uI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=gZ+C+gK9diUIYKAh9offNAR1aL3GUwTgZbV9rIHM3B1/jSHn3nJyWwkTh8jiB3bZNVTB990eXT+yznfXlNuAnrNBK7AgDiyOYT/qvNdv9f6UAb8scyuNRLLugXqLeNaIP3f9egBqYDTKzj0FHX6gS6IuwZbw45oB9ae1SMq7zJY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=Vqyxiqow; arc=none smtp.client-ip=205.220.165.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 44DKIUGc024530; Mon, 13 May 2024 20:34:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding; s=corp-2023-11-20; bh=JSbc/8eA5xrI1SaFPGINdQ50BsHMllxXcq2iZ5yctfw=; b=VqyxiqowZbDyOT15WPPMVQu3gojdreUFeF6RgmwODXq8q+a80YE/Px2p22ZrGU6KCP3Q xL3Y8PPCiJRL7obsS1xAJtlOVpHgThz0Abr9+mZpIHRANzJZH6y0u7moNSVO8Pisz6RP C2TVyc8fUKIi2GcYRbbXvZTNiJfIDG3X+/Dmhy5tGf5OKn1drhs4+HXwMiBfV89HdZcX b8YiGgGx3w7u2wFANcPJVvtNtJ4HaeIim3HC5EL92lEH8zC9oKFx++G2B8+BCMcvfMyN zlTgpcLabYlJmyHMGoGY+nRKjw+hXETOoDoexEfKKHmuImGm/yHi4DLoyypTMKBROE8Y EA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3y3ss9g1b9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 May 2024 20:34:33 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 44DKB1Qj019247; Mon, 13 May 2024 20:34:31 GMT Received: from pps.reinject (localhost [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3y3r83vc9v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 13 May 2024 20:34:31 +0000 Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 44DKYVlA028454; Mon, 13 May 2024 20:34:31 GMT Received: from ca-dev112.us.oracle.com (ca-dev112.us.oracle.com [10.129.136.47]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTP id 3y3r83vc9c-1; Mon, 13 May 2024 20:34:31 +0000 From: Harshit Mogalapalli To: Crt Mori , Jonathan Cameron , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: dan.carpenter@linaro.org, kernel-janitors@vger.kernel.org, error27@gmail.com, harshit.m.mogalapalli@oracle.com Subject: [PATCH v2] iio: temperature: mlx90635: Fix ERR_PTR dereference in mlx90635_probe() Date: Mon, 13 May 2024 13:34:27 -0700 Message-ID: <20240513203427.3208696-1-harshit.m.mogalapalli@oracle.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-13_14,2024-05-10_02,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2405010000 definitions=main-2405130141 X-Proofpoint-GUID: WX5Xu_yCNJWIukO3q5l1yaFCI8-mRfPR X-Proofpoint-ORIG-GUID: WX5Xu_yCNJWIukO3q5l1yaFCI8-mRfPR 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 --- 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); -- 2.39.3