From mboxrd@z Thu Jan 1 00:00:00 1970 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 EFF7E40DFBF for ; Thu, 12 Mar 2026 09:16:44 +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=1773307005; cv=none; b=KrnVjzfXTVOCLsKrnC+PB3S5wisZgvRQS7/hcKiv/8rMDCqMFMaEF4xv99chlGDa8UnU0+kf42j25dhU9YIOvFxhbe6lzlgtOahMsNtpDlHzqKRG5vHP4QIoF9Dy8bYsKlVRd4mR1OXwvX68nplE69LxoiP9AK54QKcpAoEay/M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773307005; c=relaxed/simple; bh=lyfvvM077w9le67FnkByCAl9dIhHMIvU1tUOdujHQuY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=rvCvJFLYa8sqVRKeIcH+jh9Wptlr7F6HuVSBNnSzUZYP/Eiy/2hhWs+hUQ8ETcW7Av6H8mJQ35rmdG4O2X25Bd1MgVAuoR/jfgC028Mna8gsVFDA2AMto2ZEDBipONIwJyUaCW1gWb3jChsniWcOaPwSiqDsfL75hPSJmVub/kk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=gGE4GMI6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="gGE4GMI6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4259DC4CEF7; Thu, 12 Mar 2026 09:16:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773307004; bh=lyfvvM077w9le67FnkByCAl9dIhHMIvU1tUOdujHQuY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gGE4GMI6HyITs1CHJ96YXS8e/cVHS8+qIhbhZQ2SStvDWQb8Mpr12XN/Mz2J0h7eB pZu7VAMqjDup1MmxUPSlr+rK6O047C/2v1UY2oSpcgnZutAjtXVvg4xKgD0aKZZ+ZZ Xx/BXbLCLdZuQrNfmMxAbKx7Ix1l2SAb0Nj5/H+0T1heUhNS1Ol9986B2nxl5S1Yq2 bhxVkA+ngm0Mg14v8V5TIr1USTw7nzWOxDm+JdZ06lxKPy+ytYpN9FBYc2Ir/8NASO /7pRR7bq+mGpE7U63tLe/iyaOg/MKStCb0aX9pgS9c+jGCuxKaJJMi+I+ulgG5BzsF A73bKM2SXT3lw== Date: Thu, 12 Mar 2026 14:46:38 +0530 From: Sumit Garg To: Markus Elfring Cc: Chen Ni , op-tee@lists.trustedfirmware.org, Jens Wiklander , LKML , Ulf Hansson Subject: Re: [PATCH] optee: Check return value of tee_shm_get_va() Message-ID: References: <20260305083312.1040969-1-nichen@iscas.ac.cn> <2e15b2b8-7dd4-4e63-b9a9-a664323ebb36@web.de> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2e15b2b8-7dd4-4e63-b9a9-a664323ebb36@web.de> On Fri, Mar 06, 2026 at 12:52:39PM +0100, Markus Elfring wrote: > … > > +++ b/drivers/tee/optee/rpc.c > > @@ -393,6 +393,11 @@ static void handle_rpc_func_rpmb_frames(struct tee_context *ctx, > > params[0].u.memref.shm_offs); > > p1 = tee_shm_get_va(params[1].u.memref.shm, > > params[1].u.memref.shm_offs); > > + if (IS_ERR(p0) || IS_ERR(p1)) { > > + arg->ret = TEEC_ERROR_BAD_PARAMETERS; > > + goto out; > > + } > > + > > if (rpmb_route_frames(rdev, p0, params[0].u.memref.size, p1, > > params[1].u.memref.size)) { > > arg->ret = TEEC_ERROR_BAD_PARAMETERS; > … > > How do you think about to use an additional label for the shown > error code assignment? > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/coding-style.rst?h=v7.0-rc2#n526 > I suppose here you meant to update the label name since it's the same error type used by other code paths too. So following label rename should be fine I think as per coding guidelines: s/out/err_dev_put/ -Sumit