Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp9518rdb; Sun, 28 Jan 2024 10:56:35 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcwiiq8KIjorUVAgnOl1ODmSP0OXiuWwiB+mfchE7XFkqRpuavA41+aHepu7wY2Rd6P+gf X-Received: by 2002:a05:6358:90c:b0:178:652e:5e32 with SMTP id r12-20020a056358090c00b00178652e5e32mr3411426rwi.62.1706468195649; Sun, 28 Jan 2024 10:56:35 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706468195; cv=pass; d=google.com; s=arc-20160816; b=h1tIprF1uCi7hTU4ONfETUn34Se9Z6mATIlO9QKi9DeMNNcwwryrvq/0pkFIq+ynW3 INB39Vt7h8A/9kPuTB70kT/5MKH1sR8MHNZg39xkdbMZ7vebLSwiPfCKyqrUM1pAjhJS kGLjNcTyAnrqc2c5/hJJn7T/IMMI/ekiFJAcSQDS0DnUEVkooeVPDMODCy+/r8Su9lXC YB8TWpkjW917iLMB+GOamNGYNLgwg3BbdS/rBht7Mol49Ax4nYeoUJepwSKP3CMw7SSJ AMKmOZzZrqaQnoYBVQtNEkMLZZz26kTTh6CjFzfpFUHPMiS5pHjy3Y6pV1syMaDc8KCh t38g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:lines:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=dxi8jwIj6370Yht9XMPObCds5jpEI29R9k4Vum0pGwo=; fh=uJ63lg5NwhmU+ik3GXHAcqxn91pi21dSeYLukgIL+08=; b=XOSwWRGjNJeenPterPqeoexAWFyOAn4QlY4xRF5ouC+6V7C3gU76AEJUcgoBL41YMj sFsdx6Imso+mFf3ERSPOHVqzQH4D5NmDEOyNXxdhTsq4TZU6ndTVOjHnhZ1ZtHQEFVwy 7fCH/678z2Tpzpcs1ASukBh/iwbwQBJeN30QaTYEw0IzL1Ob8pl0MnDJlIX+4ZTix6GD RxDrMu7pao1U21BTtc+sZ6J9soEbtswgM/Vgdv9BYU5Iyuf+Q71LCYVwODKvZNc10Chm NBakx3GUKyvNwm9LkHz0JmP/Mxm/KzrJmpsjiSyeXn9R6dXNMrkDRWpBQYgrKSP5siM0 Yzfg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IImyyOVK; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-41894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id h184-20020a6383c1000000b005d8b9ada80esi2509045pge.657.2024.01.28.10.56.35 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Jan 2024 10:56:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-41894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IImyyOVK; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-41894-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-41894-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 D5D7D283562 for ; Sun, 28 Jan 2024 18:56:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 761D031758; Sun, 28 Jan 2024 18:56:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="IImyyOVK" 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 6DA4F2E633; Sun, 28 Jan 2024 18:56:27 +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=1706468187; cv=none; b=RZuNKI17lfucpsaS3gkQEvwaqZdWLLJLrFiFsjLCPt0ncpxlAT+SpslWIP7zoGPrKa5b6MGm2SqqRBXlnDSGHOeN0zt6u61sIplKOsqMb5H7dYPIs168E3Kf/7jVVtr7aQTEYqwvJ5LFew/IVwOq6ZoVbI9ARn9UVB2zhkoCS2E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706468187; c=relaxed/simple; bh=NXn49SNNkLuAR3eI0XKBU5ciRsCgriwwJFIZaXxDi98=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JePUDrwvJ4pT10aKzRe6ScaP/h0lIaKCNsZ6pjCg/zNPd/8E0k+B12McYLk2oVnENzkZ/2fCmMVXCBTTP21B3lya22BTzDLanhl+zWuGxlrAeef0MS7zPH2b4srtKVUWRf6Fb65hVSvNHqkWQyYdGTjC4GLdK4NODxAkeVtJOQM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=IImyyOVK; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1261C433C7; Sun, 28 Jan 2024 18:56:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1706468186; bh=NXn49SNNkLuAR3eI0XKBU5ciRsCgriwwJFIZaXxDi98=; h=From:To:Cc:Subject:Date:From; b=IImyyOVKFTeWwUkB4vKyvjtOkxEfLmrw7VQIjvfKp0HqfJX4MvItOQGVnFu1ao43E uD8Xa8w+B5Zj5G8I6eo/xqpOS+uX897dfYEEoL6O64F/izJnnttzZFh71LIWTXWI/h BkZY7mz0hESA7dDIqU1al/HGIq77eD5XW6BBcLWg= From: Greg Kroah-Hartman To: naveenkrishna.chatradhi@amd.com Cc: linux-kernel@vger.kernel.org, Greg Kroah-Hartman , Carlos Bilbao , Hans de Goede , =?UTF-8?q?Ilpo=20J=C3=A4rvinen?= , platform-driver-x86@vger.kernel.org Subject: [PATCH] platform/x86/amd/hsmp: switch to use device_add_groups() Date: Sun, 28 Jan 2024 10:56:22 -0800 Message-ID: <2024012822-exalted-fidgeting-f180@gregkh> X-Mailer: git-send-email 2.43.0 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 Lines: 34 X-Developer-Signature: v=1; a=openpgp-sha256; l=1335; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=NXn49SNNkLuAR3eI0XKBU5ciRsCgriwwJFIZaXxDi98=; b=owGbwMvMwCRo6H6F97bub03G02pJDKnbFoeZmU9oi+OUNf/bHbJJyeztlKc5a8zXabdPePuk2 OVZw7v+jlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAbjIR4a5Qo7Ke2w3WD37lVqc GvKIzf3Xlg03GOa7zKp7fW0DM0exxJ/1r6a9kVfIfBkAAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit The use of devm_*() functions works properly for when the device structure itself is dynamic, but the hsmp driver is attempting to have a local, static, struct device and then calls devm_() functions attaching memory to the device that will never be freed. The logic of having a static struct device is almost never a wise choice, but for now, just remove the use of devm_device_add_groups() in this driver as it obviously is not needed. Cc: Naveen Krishna Chatradhi Cc: Carlos Bilbao Cc: Hans de Goede Cc: "Ilpo Järvinen" Cc: platform-driver-x86@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/platform/x86/amd/hsmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/x86/amd/hsmp.c b/drivers/platform/x86/amd/hsmp.c index b55d80e29139..49ef0b1d6df0 100644 --- a/drivers/platform/x86/amd/hsmp.c +++ b/drivers/platform/x86/amd/hsmp.c @@ -471,7 +471,7 @@ static int hsmp_create_sysfs_interface(void) if (ret) return ret; } - return devm_device_add_groups(plat_dev.dev, hsmp_attr_grps); + return device_add_groups(plat_dev.dev, hsmp_attr_grps); } static int hsmp_cache_proto_ver(void) -- 2.43.0