Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp3824234rdb; Thu, 28 Dec 2023 00:43:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFfZbymZVS0E1ras6BvYqN7Uc8J97SP/P2dh0lpmZ64UbqRLIxSbbqAsjFXiByQNn3lQVZT X-Received: by 2002:a50:ab52:0:b0:553:2cbe:9abb with SMTP id t18-20020a50ab52000000b005532cbe9abbmr9276707edc.2.1703753036696; Thu, 28 Dec 2023 00:43:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703753036; cv=none; d=google.com; s=arc-20160816; b=tgr7/9L1Koe2bAjegiSAT/yQgfeaenECfbVQ6Xr5GegwScdunf2JYL71lxm7fi4ky9 0GGzHMEXkaTWTmcqIEoQV0NSeyZn7o2nsZIEOxJP29uZqjKgkmBXyckMKZ7AsgoRSvCr gT0br83ySkRb+m/o6QR0XsEwYIhKwHeInJfbAmmRFkMEsW9pukfE+89WcwNyA/5MrMMu ITKOYnGfddZRWNsRl3G12tW3RpC+SCcCKWdR3399K9A1xXSSovH5qZCmulPVdoR0/lFm uVsp2NBlACzQjcm738sYL5Z2J2F6A9y/GzDb5HrRQ0WkerAEQQf8UhU22JkBKYTVhMtk hTzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=ui-outboundreport:content-transfer-encoding:cc:subject:from :content-language:to:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=/jmtEO8WZhsLeGjASrJhJxBoE0siSK5p/u0hDvRg1/k=; fh=IUK+Yqgv71aqBXrHBzznq4rkQ2XwNBWcHPsENmdJXw8=; b=O9nUWvW2TNIolXT9T6w9KRwlHM1iWprcA2b3CxLUzKm5JVfIqxL6zgLTHCPaiibx8N T+cLXp9r0Gsv0QRde2WoAde3HUNdxWgxUN6XDPQaond38rw/LNdFyxvsVaEZScpsgJEe IdbdxCLI80buy60mKVpGBB3RraZUaWYXQidh4lI1apkyfpWViUwP7lz+2kCgJz22z7oP gR73Kp/j+vf4Va5a4aHWA4p52W7dwnd2QMqZw1SkVBdV1/5oi96sOsbUCDNA35/g9NXS Z2KjpT2F686mizzg3hliMrGF8PYrbrrn2s6qUrm4KtNAy0KUucgax6vYN5quy0PeRB8X PLeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=VInzAuRr; spf=pass (google.com: domain of linux-kernel+bounces-12520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12520-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=web.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id d19-20020a50f693000000b005558e32fa28si380144edn.644.2023.12.28.00.43.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 00:43:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@web.de header.s=s29768273 header.b=VInzAuRr; spf=pass (google.com: domain of linux-kernel+bounces-12520-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12520-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 465991F226CC for ; Thu, 28 Dec 2023 08:43:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C9E263C5; Thu, 28 Dec 2023 08:43:44 +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="VInzAuRr" X-Original-To: linux-kernel@vger.kernel.org Received: from mout.web.de (mout.web.de [217.72.192.78]) (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 14FDC5671; Thu, 28 Dec 2023 08:43:40 +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=1703752943; x=1704357743; i=markus.elfring@web.de; bh=zmkIk95uAnIs9Eha5efh2mV5ML9QPD6Kxw6Fd4L0ayI=; h=X-UI-Sender-Class:Date:To:From:Subject:Cc; b=VInzAuRrkOQMpps9N+++fUF5AregOalMHU4QRqu4YesKz9EvgRS8WQvsJGNmYuMo r5Sf610vgM7T1HV0kUggWIiGcKIKAKXse2nmwVt5n2GBePiNTGp6GMD3q4Ve1QlI1 w/w5mnkyPJsRux8Pm2V5csAc6cbP2z5F9nIVW4tYy1wFL14GVKliz5z1Gs6E1lAuf kZeZCrO0DWFR1y8q4RnmmHRkxlePqz30AkLmuyjgKKYKysHmlRWsLxhu/j7NJSe6O APAuZGG8S1pB0DEPmN4r/6SrNR0QwYYtPgg6liX2aMPQ0bT2o2zLM+vu2pwefC2eP hJA33wVwTsEKFZ5hTQ== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from [192.168.178.21] ([94.31.85.95]) by smtp.web.de (mrweb105 [213.165.67.124]) with ESMTPSA (Nemesis) id 1MA4bA-1rPtlV0tYI-00BlBh; Thu, 28 Dec 2023 09:42:23 +0100 Message-ID: <362ee824-fc53-4e19-9529-8b621657635b@web.de> Date: Thu, 28 Dec 2023 09:42:21 +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 To: platform-driver-x86@vger.kernel.org, kernel-janitors@vger.kernel.org, Hans de Goede , =?UTF-8?Q?Ilpo_J=C3=A4rvinen?= , Shyam Sundar S K Content-Language: en-GB From: Markus Elfring Subject: [PATCH] platform/x86/amd/pmf: Return directly after a failed apmf_if_call() in apmf_sbios_heartbeat_notify() Cc: LKML Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:rDi8Bd+8M7STwBu7WjWgU68UfYwOYphhC9zo9TLUjNL2/gw4ycp J4dC2LEgVEZ0cy4oZuKBDKYc/rrlyV3gHUvEm7tx3Y8s7JwsP1rBFIBYtsc1HAKJLVinrMW 5GdwGEUlddGfgLCN/j6TMOPltug/QW9cSIQRzKetAXxOggTRSx0bs5VsUq6Ntph6V8Aa5iU wqhVApVWx09AJqMbdLo7A== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:nkcMUES01yM=;nDLmN1ZD4ajl/27Ge923Xf1FUDM MP7MVJK28721tsglhTeWNgNnkqAfHa2BNDDbWRUT8eap3W58ga6tjws0Mmp/669BEFcKozGkl sZEuZEusG4MGTsc8/C42yFGVQXKND1zsok2rnjiqe3bwTzH+IfVkLNT3x78ONettyfbN6Ox9H d2ECedJZdFLF69Jy/L59MiW8hLxXQ8W6F3dEtgk38b8/2hrV8JcPXvDpuJKh91aX3ZA5icmEN RRh+NNW1KkFFEs0PfBZEmdksgrSgcP7Ik5zc/0zntnqR7uT614JmX9JOnh/DcIvihTA8PfB5G Fk8+1sS7pDLAp4PMZeWQw7z90W0IV6OZIs1Si9cvLBhCClcv0GJq6Nrg07gvT4NAtAipEW3hu GcnEGI5xjYgqQQX/uWDpfwKdQbjOr64zOovIlBIOMA/Zlbe3u0N3ZD2zhd9nyIzmm+d6Ql/7g +YHTC8AA9rr3LfMsL189/vl7AMfssb7UBj0//07wEuprvWCatqx6MgYTxEyNifTS8kgsnojio lkKlb5scziE3v915s6WdyWldPbMuo4XifACJxmnpVGTRegbVWf3v60ZZ6WXOdrpD5HOfTzuPo lf51sDc0XPAVSWMcQESKdsCLmuddMYF+ZKhELnXJ7MtyBKtWNyj5QFikjyGLReu0IitwdeBoR Z5wvK5STs82RUa8JTeDpJL/UCHzX3zGPeFqNWN/OUQE/XFa8WRNjeDgPqQC5SI0J02OBooV1I +f1NXCiD8pV40vgHLMXLJjbL98l/ykK4Jr8IuZJ/AmQ5qrMjSkW8ecU8Zumo3Y383NHjJdavr YGGVGfhElG/GBQaIGpUtAI4lxDpa7E/x2eySGjcRXwhb5AdV+9ZySacQDprD/4gvqZDOJykDc tzVJVj3oRpBJSXxDHrlBZtKBCoE4bTmfRm2vTS9WqYx6wy+ylmeQPIi/YQKPBY4vQCjCNtXMt rZsEJA== From: Markus Elfring Date: Thu, 28 Dec 2023 09:30:54 +0100 The kfree() function was called in one case by the apmf_sbios_heartbeat_notify() function during error handling even if the passed variable contained a null pointer. This issue was detected by using the Coccinelle software. * Thus return directly after a call of the function =E2=80=9Capmf_if_call= =E2=80=9D failed at the beginning. * Delete the label =E2=80=9Cout=E2=80=9D which became unnecessary with thi= s refactoring. Signed-off-by: Markus Elfring =2D-- drivers/platform/x86/amd/pmf/acpi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/platform/x86/amd/pmf/acpi.c b/drivers/platform/x86/am= d/pmf/acpi.c index 4ec7957eb707..eb367e38c5ab 100644 =2D-- a/drivers/platform/x86/amd/pmf/acpi.c +++ b/drivers/platform/x86/amd/pmf/acpi.c @@ -135,11 +135,9 @@ static void apmf_sbios_heartbeat_notify(struct work_s= truct *work) dev_dbg(dev->dev, "Sending heartbeat to SBIOS\n"); info =3D apmf_if_call(dev, APMF_FUNC_SBIOS_HEARTBEAT, NULL); if (!info) - goto out; + return; schedule_delayed_work(&dev->heart_beat, msecs_to_jiffies(dev->hb_interva= l * 1000)); - -out: kfree(info); } =2D- 2.43.0