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 5EA5D143C61 for ; Sun, 4 Jan 2026 22:50:30 +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=1767567031; cv=none; b=UYjle9HeapczRjfryacGOcP3lmka23q86Zbh9+W1941G2cjRdUtQTMa9QrTPuhdOn+nEzZjPdsg44jYlZ1TvNXgrzb79Pcuv5RSDOAlfbczLdhOYao89LxUtmdFNwzylqP3Kb8i4feXh9xG0Bu9vpB9TBW4x+sJ0iYWh2SL0W28= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767567031; c=relaxed/simple; bh=BUnBtuxk0eww1XMZ3mAG6YmWxZYPpuxsb7QXsefg4AE=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=VFh95orMEhf1/d0QPVudY6oUlYz9iUEF9nVrpEDA6/W/5ofkdIzVRq1rtj9+bqn0IkqTmxC4SPi8HZ6YE91Cv5YF21tFYB8NuhF2/086ZGfHniakCTfb1rDIsWG6/sccoQaNN/PdCD++B5wlfMANO9thnEhpAPvclYTpa3XqJZ4= 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=kD+D91cN; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BlRkWLpK; 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="kD+D91cN"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BlRkWLpK" 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 604LJdpG3631794 for ; Sun, 4 Jan 2026 22:50:29 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= Z4OECOH/li4HpE49npbmoa6u/pIY/YVgufugJfqG2z8=; b=kD+D91cN7PlcIJIv C57BwI35lnkMtfZW5hRPub/pdbtRHDaIcQRMkjpVYBb7/w9orfJXQJ1H+hq8i6lg USbD7EODB7of1qHzJJomOw2wmYmvNh4T+CU92tVqIN9s+1xJCifXKixiFWMaWkKB uMV8mRu0etU+tKSIwkz2wg8oBssJN2sRWMrfl37/dKjnjYk7iicSlxjdAtMWl1pM 15Wgo6kNo9+tTmCaKvJBBZQman92I5ZOMDgJ6IeFYojBKX+H35RPoHQhOAn+W/fe ZsdeFd2J208zlb9HJzSYHjHSjOOCraXTd/EeYy5SHipacnONlH4Mo+jntGOFuZQx 1G7fAg== Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4bf577sw7k-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 04 Jan 2026 22:50:29 +0000 (GMT) Received: by mail-pl1-f198.google.com with SMTP id d9443c01a7336-2a0b7eb0a56so327488915ad.1 for ; Sun, 04 Jan 2026 14:50:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1767567028; x=1768171828; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=Z4OECOH/li4HpE49npbmoa6u/pIY/YVgufugJfqG2z8=; b=BlRkWLpKF0qP8um2xdbrLzml4oimg6vIP6DDhGqbu5MkEGPxbYHvDLdEQgO4a59RIt l5k3bHadPn9hhsEZr5QrFrwGKI9grSk01L31hpkSNNDxxFeNp69LEmK1t0kFJTqSrhzX Uifa1uE8mYNL7qOFIw7kI1C5JKgdlhd+NVsZhVpAQxPHn+RB7hk5GcI8FxJHF6JVWN4Z 7bjUivB77klmzJqD4d2N6EDikkQPSQlbIzLVAJXJY8qNTMW4lwEYEts4rs1mG81Jjzj3 xCxWka6P9KXubrH1oWY+McR1NQZWgDFrvXQ1OUpra+A0seKD5zUigsoseeaqzRfG/DYz Ly/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767567028; x=1768171828; h=content-transfer-encoding:in-reply-to:from:content-language :references: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=Z4OECOH/li4HpE49npbmoa6u/pIY/YVgufugJfqG2z8=; b=Cp/Wt/Z7Zatkg/cHyFxtZn5WvG3ZEtcYxhoAsvZyFu82IF2V9yPF5x5Eu+x+ssMmd0 PfsmUss8ihlrkKA3XROmtNJZQPq/GT7QNTnn+WtYuEN2E6tjDQIXMbGP5VjjQRkBJVPE YqYgCuZMAzc4I0yIPjGQZWq0oxfaKHpAydieyGfmxLeW9MXjbSlV/1axxKKOtnwzirOx 4XZhNUJ47DBwua0L4fkY39xt3ZXFQO31xqKf7l8j8P97hgDFr2Dd15yGVufG0aMvzXYV pGVRflhVYRDG3oc6ZUG1Q7fFzxOsVQEaHVmqSCppNiaD0+GWsFG7CUnnPtn0u9F8pGki TC3A== X-Forwarded-Encrypted: i=1; AJvYcCUPGQ/TgdFRQ0RTs7mk+gYRlw35ZOyfbZslcEhloFe4Ns1VSefQT6oRaiyKo1g9VzeS4CqmHF26/MWthAI=@vger.kernel.org X-Gm-Message-State: AOJu0YxRup5CC3MmhTYZ8shgmIUxE1PobUSi/ftnprqanxFEIRGeoxYZ b4t8X7fd8EA4NHzyI7pfzooHm2uG41il4eCsfos1lmQ5oPM6V18p5eyPtgHn1+Q72oHH+KCYHqk 7L4vXGJIPxbzZ1M0fE7phniql/XbV4Ak2ShFJkHxiifDBxyWRXxVy2AJ0INZBZv2OZg== X-Gm-Gg: AY/fxX42W1qFES/wgdlLEDn1oifAHySBac1anAeULAo5nleu3t3tfBQw4R87fCAr6Xi ZEGgfE2cZFUx4oTN+1sJrdHZWVRGE3Ybo9w6L3opQuxngcpiMn4hUARWagS40InnYPhtYog3h7h 6bUBkoaUjMeaHmD0T6dTit4hXZzGY40kKSYocb0vdC6XDF6sgP1Yg73WMJP4w5M3BfWI/PUPR81 6aMPdab2H9SZWTtnrL8Hl+Uov0Akt7D0CiQwV4L61toqtJMco8W/MIuKkx/z8kzFKAOucT0VXUF zyRGtzLRXvJhL2RxR++cdJdG66eqCtrWEQhUvyfmSi8Ra1iNn/cKJzghsUhNBeHkpt1UAmofq1o /e//N/Ei2ZbwQox9uGGnwyk232buGKehOFQhyYEueSpZ3AU+5R2dA5hoPmBlv+Vi7fx0H0VEOxG P+fkSAfwY= X-Received: by 2002:a17:903:41cd:b0:298:55c8:eb8d with SMTP id d9443c01a7336-2a2f272bd8fmr421732185ad.35.1767567028064; Sun, 04 Jan 2026 14:50:28 -0800 (PST) X-Google-Smtp-Source: AGHT+IGSpjXMvZibipryUoqrlDqr7k2nu+DSzDZ8V71fOSDOZKY0FvdhnKHBf75BqgIzwl7VSPS6bQ== X-Received: by 2002:a17:903:41cd:b0:298:55c8:eb8d with SMTP id d9443c01a7336-2a2f272bd8fmr421732095ad.35.1767567027574; Sun, 04 Jan 2026 14:50:27 -0800 (PST) Received: from [192.168.0.74] (n1-41-240-65.bla22.nsw.optusnet.com.au. [1.41.240.65]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2a2f3c82762sm422934305ad.27.2026.01.04.14.50.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 04 Jan 2026 14:50:27 -0800 (PST) Message-ID: Date: Mon, 5 Jan 2026 09:50:23 +1100 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 3/3] tee: qcomtee: user: Fix confusing cleanup.h syntax To: Krzysztof Kozlowski , Jens Wiklander , Sumit Garg , linux-arm-msm@vger.kernel.org, op-tee@lists.trustedfirmware.org, linux-kernel@vger.kernel.org References: <20251208020844.5310-4-krzysztof.kozlowski@oss.qualcomm.com> <20251208020844.5310-6-krzysztof.kozlowski@oss.qualcomm.com> Content-Language: en-US From: Amirreza Zarrabi In-Reply-To: <20251208020844.5310-6-krzysztof.kozlowski@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: _o2fuOYErj00olU_ydF1qIMUrAOAmlPq X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTA0MDIwOSBTYWx0ZWRfX0h3yHZXyEQW+ rAZIPtm06I4m560fQDGb8F6AsVY2RCeisGrfcz3KyvgRNxn5c/JMYlk8xI1Z3Y29aJQgqy4Mi96 h19PpXfT1j0+mMEeF8QR0evBq+Ts3IHMySOyv8BZC3zkYiJpizwh/Ta1F6ri0pLl9VKGz651eud /j2chCvjGm5CETsr2PP2gMlWcK0SsUiG5QDMDSiFLHc9UGxRE07WgvjNi7AojWpsbioZBuw70/j ptAVnb+T2IQ0HJD0FIXrlTwXFDOL3y6D9GEAfoVehArdiJ1FpVsGyiwAaE4/zXlu+9VC53o6/u7 VSamIi8D27bvFdUcEulaWi6VCO8oo95nb2RVCXr6QZakd1deZ2/xT7bOFmq2Oxn4UzMAzQ3c+ot 11hBIb7WahVWJFTNdBIk3mbYZfaNgkwW5yRVBkPIrqYBNd6cjGrmyBF/qxsv+N2Y3EOQcOI1z+3 p+2IBSVPvsQbu4uVxWg== X-Proofpoint-GUID: _o2fuOYErj00olU_ydF1qIMUrAOAmlPq X-Authority-Analysis: v=2.4 cv=d+z4CBjE c=1 sm=1 tr=0 ts=695aeeb5 cx=c_pps a=MTSHoo12Qbhz2p7MsH1ifg==:117 a=hi51d+lTLNy/RbqRqnOomQ==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=EUspDBNiAAAA:8 a=XSG46yrzQr2AIDBsqHYA:9 a=QEXdDO2ut3YA:10 a=GvdueXVYPmCkWapjIL-Q:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.9,FMLib:17.12.100.49 definitions=2026-01-04_06,2025-12-31_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2512120000 definitions=main-2601040209 On 12/8/2025 1:08 PM, Krzysztof Kozlowski wrote: > Initializing automatic __free variables to NULL without need (e.g. > branches with different allocations), followed by actual allocation is > in contrary to explicit coding rules guiding cleanup.h: > > "Given that the "__free(...) = NULL" pattern for variables defined at > the top of the function poses this potential interdependency problem the > recommendation is to always define and assign variables in one statement > and not group variable definitions at the top of the function when > __free() is used." > > Code does not have a bug, but is less readable and uses discouraged > coding practice, so fix that by moving declaration to the place of > assignment. > > Signed-off-by: Krzysztof Kozlowski > --- > drivers/tee/qcomtee/user_obj.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/tee/qcomtee/user_obj.c b/drivers/tee/qcomtee/user_obj.c > index 0139905f2684..6aa3aefd67f0 100644 > --- a/drivers/tee/qcomtee/user_obj.c > +++ b/drivers/tee/qcomtee/user_obj.c > @@ -228,10 +228,10 @@ static int qcomtee_user_object_dispatch(struct qcomtee_object_invoke_ctx *oic, > { > struct qcomtee_user_object *uo = to_qcomtee_user_object(object); > struct qcomtee_context_data *ctxdata = uo->ctx->data; > - struct qcomtee_ureq *ureq __free(kfree) = NULL; > int errno; > > - ureq = kzalloc(sizeof(*ureq), GFP_KERNEL); > + struct qcomtee_ureq *ureq __free(kfree) = kzalloc(sizeof(*ureq), > + GFP_KERNEL); > if (!ureq) > return -ENOMEM; > > @@ -367,10 +367,10 @@ int qcomtee_user_param_to_object(struct qcomtee_object **object, > struct tee_param *param, > struct tee_context *ctx) > { > - struct qcomtee_user_object *user_object __free(kfree) = NULL; > int err; > > - user_object = kzalloc(sizeof(*user_object), GFP_KERNEL); > + struct qcomtee_user_object *user_object __free(kfree) = > + kzalloc(sizeof(*user_object), GFP_KERNEL); > if (!user_object) > return -ENOMEM; > Reviewed-by: Amirreza Zarrabi - Amir