From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 9582643F4B9 for ; Wed, 8 Jul 2026 11:19:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783509576; cv=none; b=ISHuI7+ZiLJAaB5qeqfpLS6S3VCgYY8T+zQp1g3phW6s8HcKoi8NqAm2h0yJuSp/RbTZDIDRaRlRbaWxWXf8NlmsOnDBjYNN5kw6b7V7kZZJgJqXdjDyxPuIUFKq2CPZ8FBlFCNyvAzcbfcBsUUAdlHeWWT+qI47R3kWdtZbReA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783509576; c=relaxed/simple; bh=1Bu2bsvkEVqEImDM1RKDkfEvjpFS0t65Hu+YiLDoIKg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S/LGx2e+qOtYt6QX9Nqlz4WIYdE4bLxMPeHhp9W3xIdH/bWAo1SOCAjz6VWUYZPVgC+2fqEIVVEiwc9pTrPwrjxMiANglNVsLKVoVMSy9tOMIPUBoiS5EoqRsaqB7W5NrH4uRGyfrpfpqKJgdzGPZlihXPWbA23Dm2wAkpq3b2o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=Nh3Y8m0q; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=fP5fPdSR; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="Nh3Y8m0q"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="fP5fPdSR" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6688AALQ2222737 for ; Wed, 8 Jul 2026 11:19:33 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= oTmYSciHNHuBsQCBS4o6R2d1sOrn6HJvwBfNDLCb/z8=; b=Nh3Y8m0qUtuZVVBk lQZbqP4LbQC6FDXuTwVmg742dHSix2M5A33Fd6Dja2sCBWaPv7imheQA8oIT5H35 4yHQ9/fiFv8OQL019Y0puFTAO1PO1Y0dmfIc0qAktC4RdjA6XfE0wfwG4dT35zSl c/+UE7xGkxD6V7+vN3mjGp+xw8ZYDWgKxxdGgRFFbAfts9zT92cAOt1eZ53Jc3jI P6b3KueZZp5rbvvdBw4mfEbrZsOtQiiFm+HFIsBZV4DpeIkcZsEKY3k7nvHWDc4l /0YCqLOBTtk25g8POm0RWH75JiXUaiZ8LKI1sYYCkRwPBl95srqk29NBR5OHB/rl x3lkfA== Received: from mail-qt1-f197.google.com (mail-qt1-f197.google.com [209.85.160.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9csst65w-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 08 Jul 2026 11:19:33 +0000 (GMT) Received: by mail-qt1-f197.google.com with SMTP id d75a77b69052e-51c075c1e25so4823731cf.3 for ; Wed, 08 Jul 2026 04:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783509573; x=1784114373; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=oTmYSciHNHuBsQCBS4o6R2d1sOrn6HJvwBfNDLCb/z8=; b=fP5fPdSRftGPlng/axL97gt8xgsTxaAhacEptviwhe3oE7lUIvIgYJAJwYFbIgmeVi ZqO/q4b5AOMvPxrabLtjDYMrByUfGlaNJ7oFnd3IsxEdOcjutxUJYW2Nio5ByRhUEfO6 TgPwCgq/puJQsr+dZDFLSum9VR3iyk9Te47brB0xiEmaTYEazeyLTz/0rKk0XAsu5Nuw quCJpF10BMRZKWftSk33RULG/xiQNGfykbUrTyJCsreDOp7H4wmo8bdaGOQ5u6zsbem7 UtVGcJWLhRub2ByHJ6Avq7ixDnOReUOwPp38tv2ne+I5ua2MiMP+99HtDi6qjnOUCIlx oxtQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783509573; x=1784114373; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=oTmYSciHNHuBsQCBS4o6R2d1sOrn6HJvwBfNDLCb/z8=; b=L7Pwq/d1YiarBedZAc+OxS5JlBOJ4dwhJg74mAQ9uAZjTrAAMIaMcdpV9vbqogioXT BBQSLzxb8Aw/fZn45gGsf6HDfVaXI19JXb1SbX99JgK0W1e/bS2G+XQ/xnBGNmgb8YEk rN/P2dDQuJtF+lj5r7C48q0PGnM8bGzummQJtKjpK6Z8Zdxut8Z5L6tJOtJXQJgu7dTH eTmUnZeZrDgJNd6ljb1vP2HjNAwbBVxlSB259b/Kas9QMuxsyzd3do/3lC4+7Mhin5ha D2MpUXHThiGwoR51jzEFBXgdI7+mVOvC+nUCwAC2d3pqI2AgwmqY0+AcaBnyd+cA/E6y /3Hw== X-Forwarded-Encrypted: i=1; AHgh+Rp57WPbWlF8wDI4q7JvXc70tl7eU3hI+Ut9n9qFuVZ+kbFxNUSsH5p/uyPjm21+4K3mTDCq9qyoXbqarcU=@vger.kernel.org X-Gm-Message-State: AOJu0YwDKk/7lbJdBO6CsKSxjPR0WUf0FdcF6cafGP9MTQHy/xavuuDu IW3uNq0Lu3QyYCZLJeytAwfF0QL5kuzMw1Iym9ghpBsuJe+lEsBytErNasbavE4uuspBcF94tK8 z2/QmXWgaf63bIU1C9dXvNlGcplJ1YChqp+Rnh/1rQVLRbqenpTp6o0Tuj/oHwZrkvf8= X-Gm-Gg: AfdE7clFabF6ogeqAtvtkV5pXObDRIqYShd6Il1GXS0cd3t8BtbPBWVZUj6sgSaDjM+ FkQd+eVpRcxycrZPCLug54wb37pYZUghuSGgr2U1922VAZhN/9jVjqOibUKTBRPWiufzgmRg7C3 /gdFAlyN4kBFKoSyAKnEgTGg0/sVsljx/6/WhBDUh2OxpVNwvJKDcaEwcnR5Zb84ibkxLjv71v+ 7/ZuYpqqxYE2VYLzaiFyW0kcrVlzWqu4q5v6Zv60jPAb+FOzJPkeMe2+aQCkWKSytYq+dOL+6op PQSFF/ljx3yDXAi3oNVkN2RJl9ldo4j5iwsfdauNBKhHxZgrf9R7fLhpSPtYf/E9SlxGyDFToRX olOOJFkmLQaNE/0abbuP1X4O0RBgjBtp4Aaa05PV2nf7DL6W6L+LYioxEXkO8y3PnDDqMHSFn+A == X-Received: by 2002:a05:622a:1104:b0:51c:1c2c:a8bc with SMTP id d75a77b69052e-51c8b45709bmr20330821cf.37.1783509572930; Wed, 08 Jul 2026 04:19:32 -0700 (PDT) X-Received: by 2002:a05:622a:1104:b0:51c:1c2c:a8bc with SMTP id d75a77b69052e-51c8b45709bmr20330641cf.37.1783509572493; Wed, 08 Jul 2026 04:19:32 -0700 (PDT) Received: from ?IPV6:2a05:6e02:1041:c10:9094:f7db:443e:b97f? ([2a05:6e02:1041:c10:9094:f7db:443e:b97f]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-493e0fbb410sm134729405e9.12.2026.07.08.04.19.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 08 Jul 2026 04:19:31 -0700 (PDT) Message-ID: <91e4b9ac-7967-4e8c-af3e-9d29fa813fef@oss.qualcomm.com> Date: Wed, 8 Jul 2026 13:19:30 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] thermal/drivers/rcar: fix error checking in probe() To: Dan Carpenter , =?UTF-8?Q?Niklas_S=C3=B6derlund?= Cc: "Rafael J. Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Geert Uytterhoeven , Magnus Damm , linux-renesas-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org References: Content-Language: en-US From: Daniel Lezcano In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Authority-Analysis: v=2.4 cv=EtziaycA c=1 sm=1 tr=0 ts=6a4e3245 cx=c_pps a=EVbN6Ke/fEF3bsl7X48z0g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=pGLkceISAAAA:8 a=8aaFJO-Im-9i58NN_ysA:9 a=QEXdDO2ut3YA:10 a=a_PwQJl-kcHnX1M80qC6:22 X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA4MDExMCBTYWx0ZWRfX/CScsr/n9En2 zoAQJRiWxrvXLeSwZlKEt0nCcjfHZJhDMneICoOUxAepxQBR/rVI68SDw06MBaDbiwzWbqL1SO2 mIyqu32joWLNtsmXc2vqSOo0MWZUbSbPkYJDL96OMdZGYrAiaj1xqyDfgyC77hU347kRIbmavrc uokpqOxqH5QbiBE/3yL93bqKQBms5NnBs3IcXTMwXTuKTsBp4KB0/v7jFlNjF+hqUzZ303KvZNx xDJ6/UPM++1AfH+0FUgQVx56DH/q3GhFnDXv+uftZmoci5AdPKifi94cx4e9rwHdmj5u5ww/fEI YKiz0UHajfauf0tqJahl07XyHQx527aRLa4VD6Wc7xX3vUbjKPldKhnxm6yOr8e1xDfr2EL7sq9 ZzpIkBmT9a4CM2SIbWWjsLxHCp0sLPuvmvXYjqUgi7JkANt83BnKyhY2q9TPyc0+3cjA/CqgljE yFeZoS9I8rC0Wta5jOA== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA4MDExMCBTYWx0ZWRfX0IE3Nj1/6Q0z gRIIWqjO4X5mUwwhJsaUhh6w/3emwPVz2i/6dsIrtG+k509iw6u5fd3lDQ84sjGeK+2ExtHyNUA dXFOUgIPKcHs0khZHOSctDbJWqTr2RU= X-Proofpoint-GUID: hK_NKRnJ6QncoOrLWLkYbK4zkFwII1Wx X-Proofpoint-ORIG-GUID: hK_NKRnJ6QncoOrLWLkYbK4zkFwII1Wx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-08_01,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 bulkscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607080110 On 6/26/26 12:38, Dan Carpenter wrote: > This code accidentally calls thermal_zone_device_enable() before checking > whether thermal_zone_device_register_with_trips() failed. Move the call > until later to avoid an error pointer dereference of "priv->zone". > > The driver works differently depending on if we are using OF thermal or > not. We use thermal_add_hwmon_sysfs() if we are using OF thermal and > call thermal_zone_device_enable() if not. We can share same error check > for if either of these fail. > > Moving the thermal_zone_device_enable() call is a bit cleaner as well. > The original code used a three step process to cleanup: > 1. Call thermal_zone_device_unregister() to cleanup. > 2. Set priv->zone to an error pointer to preserve the error code. > 3. Set priv->zone to NULL to avoid a second call to > thermal_zone_device_unregister() in the rcar_thermal_remove() > function. > > Now we can just do a direct goto error_unregister and rcar_thermal_remove() > handles the cleanup properly. > > Fixes: bbcf90c0646a ("thermal: Explicitly enable non-changing thermal zone devices") > Signed-off-by: Dan Carpenter > Reviewed-by: Geert Uytterhoeven > --- Applied, thanks