Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3460218rdb; Wed, 27 Dec 2023 08:04:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+ldsDeerUM9MqtG/e97Eha1DUkqd0sEm5elqC4EV51w0CZoHsC7KohaFOBhcRsUdjU5AF X-Received: by 2002:a17:902:b216:b0:1d4:7d21:70ee with SMTP id t22-20020a170902b21600b001d47d2170eemr1556378plr.103.1703693068840; Wed, 27 Dec 2023 08:04:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703693068; cv=none; d=google.com; s=arc-20160816; b=svIZn802a25xpdY+ahTfTkal9OBGPPP64hCZPbtZCJK5Ryj8boapkTd7UqClFW6n3A 8v24kG327foREpAcEm8coVuWnJ83X9whqOmMT6rq83Oy457ZQ6rLyF4I6GPefYS85NVp y+ramV3y/frevponHQDzbskTzrthiLYbA+253w/sNSBAbx75ROXxfnpZg3YoH8ord/nU +HgP1EPq41MiyKHf83UtUMXPczYxJUEgzKwi2zvinqPRwNDxnorIWv1jaNI9Yfbzi74q ll2wWsEqN+jbNLEvUa3s47/9+qJaU+0E0kUBksem7FPQdBsfMv9YPkeMlDSAGbRE4Zq4 +bCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=UwN1jdj/YX9hyFBqnaOQu1V1PR41c/f5krQQFt0SYfs=; fh=wuUie5oKaq1rnJGkqsLBDRQIVcNxT7QBjvnuAZyxq+E=; b=x3Ou3EVrwOuz1/rFSOSoryznRfoKd4Q40JB6w9V++UkUsrtvO9+chyGPxLPECF16iy 5b9T4OyLP6yI83etDk6NZvIwlks1V7YyQ45da+qzG2e5rniBtsjDuFLcSSEgm0CO4kNs YxR+wKvjZxWqHDOt+mU+97oih5aJktYm6vsamyJWRQDJU4dF2QLwEntgWxarsM9YJ5E6 xpBo+xdsqzhEje6barcRHbrELpT7Du7sRVv15/xkMMwdVyfk9oLMTi4dm2rV72gh/N3k +ZxKCsw90NxN3bRCOilSRT1tf1D+tc4LSHJO7Fq6u7MxJVrVIeq/BrzN0Xm8dZehmNv0 xVDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=Lc7DXIYX; spf=pass (google.com: domain of linux-kernel+bounces-12101-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id h1-20020a170902704100b001d3bf26fd7csi11323854plt.305.2023.12.27.08.04.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Dec 2023 08:04:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12101-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=Lc7DXIYX; spf=pass (google.com: domain of linux-kernel+bounces-12101-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12101-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de 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 7D321282BA3 for ; Wed, 27 Dec 2023 16:04:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0932D45C0C; Wed, 27 Dec 2023 16:04:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=web.de header.i=markus.elfring@web.de header.b="Lc7DXIYX" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [212.227.15.4]) (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 0FFA145BE1; Wed, 27 Dec 2023 16:04:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=web.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=web.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=web.de; s=s29768273; t=1703693048; x=1704297848; i=markus.elfring@web.de; bh=pl0j2jlBOHpdYumEB//84LCnmc+A204WKvvK9JoNUAE=; h=X-UI-Sender-Class:Date:Subject:From:To:Cc:References: In-Reply-To; b=Lc7DXIYXmosy75uibtNwU2cS73VVZK/cSY03ClKiUfkc3xCBdEUSUhUXcM/eGCuf A1UIWN9B3ov2GXqI0XIudj3W5EBW9Z9gJ1fS2y6hMbedWD6vfQe4PkP/BHjGmUwrt BV8S1Sxtr2OMJd6m2ScU2zt6gfArVTew+s7tFcTz8VBc2coa4xv9YMSqaaYsRrXcQ zeHkfXjEb7GNuEyGITi/A/jgI7YZRRIweLFtE7qEyUUvAn2j4PSwxbIIJeR3JEhxO nXQY6uNdJYdjqGEIC2zDiFigS/klkNAI7h66Hj95lkG6bxYIc3v7wYp6HxffD+Lvn QLvkSkGoyf+g14M72Q== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MsaWF-1qzbcp0V5P-00tfcP; Wed, 27 Dec 2023 17:04:08 +0100 Message-ID: Date: Wed, 27 Dec 2023 17:04:07 +0100 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: [PATCH 2/2] nfc: mei_phy: Use common code in mei_nfc_connect() Content-Language: en-GB From: Markus Elfring To: netdev@vger.kernel.org, kernel-janitors@vger.kernel.org, Krzysztof Kozlowski Cc: LKML , cocci@inria.fr References: <9a683f73-c5a2-4b80-af1b-01540834a3dd@web.de> In-Reply-To: <9a683f73-c5a2-4b80-af1b-01540834a3dd@web.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:LZLFy8584bM7nNvphHPs21dMyK0NX/xpt7a2sjgekqHU4DF+tEL WjRYzV4ttYUlRj83D4tFBpGhcOM+pyUOdHz/+n+XxOJR9XwmI7NIjO0jcbRPnq2irlBhPI1 k5lrKOh4gkYiiVMVFys6gf/EnPWuWSSD4VYet/9cD1aRbzIDHxqWH8wPNQho9BZeYQmoeyz sI6ttaVBn4EQG3K3p56TA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:CSPkLoRkgos=;ca8zaDvllZcwLBz4r7X8tu5athr 2swnmbXxg5vxZkB9gKnLlviRogKVGDF9nzhbue8EZb4Q+BZU/DTtLKc6h88hpx2K2OECRMgbU dbzQIp+MWaBHtLEs9+BfDfFK7qvcJofZba7MESK82h52cTvvebloPxGO+Y63Ale2OTiGiWxcW YQPCuqOhhSKeZcTSudoCje9/Uhv0HZgSm6WIzM/A/DbmNjTgpm23Zcr+5Pz6oyvfif9Xp0tex BfGmJIEHjUnruhlX2YcaRWFPfUlmcRgw5fvidF+ZElxHySRInhMvhZh2za85Q4JRL1TC7lQOQ fO9Qkfag6b8moUMWqqLVC0a+TvloxQIHL+/Ev4clZRlRu0fxCve096umXkb60T0zuVe1VQ1e3 WiutHjb/l/ByZG23vYJSY3gMizKk2l/v4xYBUS97KIsBAtZF51PuxVtUMXnkBzWyIO4LG8IoB o2uMk+khs3zM8Zxpbi7OPceEhO1kO4feu8cdULHTeF47pzm0pxuykc8RRpcnEtRJ88GBBkuik EwulqbHTlCz2xBmSe5GO+7V+s8mF3T+E5S0LwU5WFiAreyiH2y4DpJG9bW2PN8bMUTjBcoD75 74tSywDeRvIOK5aFVkQZoOf7M7yoEJO/of2WreZHJeoSswGFpUfsVKU1NigxW0+PSd0VtHloW 1fKcVONAIFPQFiIjuW5A9OsUWaILggTjAbUFHH6m5+jg2KMbuo1ySyCroRAuRA8eU3iRV6Ozk 1Z19v4Fgq3boKVUyJGci/As68vXOL/5mxf3+JjBzLh5WllGWRQKMEgtnIGa+YGcv23QT7fPDN lVMp2+pW0Vy9UVXKym1ueqEdf3gTvRvDDMlGC6FQRwXtW+UBqXS9w4CFOhTWpafvhCA+Y5kkG mqzltRDgxuhznRqYjNunl9qvC0l60YJyCdhl4l7TgMg2LbHD2fwP9kZ73br6Vo/JsTHeVi7Ka 3pO1DrocWNovKtms3CXZv7rnWu0= From: Markus Elfring Date: Wed, 27 Dec 2023 16:45:39 +0100 Use another label so that a kfree() call can be better reused at the end of this function. Signed-off-by: Markus Elfring =2D-- drivers/nfc/mei_phy.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nfc/mei_phy.c b/drivers/nfc/mei_phy.c index 937f229f4646..9272564012b3 100644 =2D-- a/drivers/nfc/mei_phy.c +++ b/drivers/nfc/mei_phy.c @@ -157,8 +157,8 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy) reply =3D kzalloc(connect_resp_length, GFP_KERNEL); if (!reply) { - kfree(cmd); - return -ENOMEM; + r =3D -ENOMEM; + goto free_cmd; } connect_resp =3D (struct mei_nfc_connect_resp *)reply->data; @@ -197,6 +197,7 @@ static int mei_nfc_connect(struct nfc_mei_phy *phy) err: kfree(reply); +free_cmd: kfree(cmd); return r; =2D- 2.43.0