From: Mario Limonciello <superm1@kernel.org>
To: mario.limonciello@amd.com, basavaraj.natikar@amd.com,
jikos@kernel.org, bentiss@kernel.org
Cc: Basavaraj Natikar <Basavaraj.Natikar@amd.com>,
linux-input@vger.kernel.org
Subject: [PATCH v3 2/2] HID: amd_sfh: Avoid clearing reports for SRA sensor
Date: Mon, 7 Apr 2025 08:47:49 -0500 [thread overview]
Message-ID: <20250407134818.805775-3-superm1@kernel.org> (raw)
In-Reply-To: <20250407134818.805775-1-superm1@kernel.org>
From: Mario Limonciello <mario.limonciello@amd.com>
SRA sensor doesn't allocate any memory for reports. Skip
trying to clear memory for that sensor in cleanup path.
Suggested-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
v3:
* Less changes as amd_sfh_hid_client_deinit() covers a lot
v2:
* New patch
---
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
index c1bdf1e0d44af..803b0894a0bd0 100644
--- a/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
+++ b/drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
@@ -237,6 +237,8 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
cleanup:
amd_sfh_hid_client_deinit(privdata);
for (i = 0; i < cl_data->num_hid_devices; i++) {
+ if (cl_data->sensor_idx[i] == SRA_IDX)
+ continue;
devm_kfree(dev, cl_data->feature_report[i]);
devm_kfree(dev, in_data->input_report[i]);
devm_kfree(dev, cl_data->report_descr[i]);
--
2.43.0
prev parent reply other threads:[~2025-04-07 13:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-07 13:47 [PATCH v3 0/2] Fixes for SRA sensor handling Mario Limonciello
2025-04-07 13:47 ` [PATCH v3 1/2] HID: amd_sfh: Fix SRA sensor when it's the only sensor Mario Limonciello
2025-04-07 13:47 ` Mario Limonciello [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250407134818.805775-3-superm1@kernel.org \
--to=superm1@kernel.org \
--cc=basavaraj.natikar@amd.com \
--cc=bentiss@kernel.org \
--cc=jikos@kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=mario.limonciello@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.