summaryrefslogtreecommitdiff
path: root/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
diff options
context:
space:
mode:
authorBasavaraj Natikar <Basavaraj.Natikar@amd.com>2021-05-12 16:11:55 +0300
committerJiri Kosina <jkosina@suse.cz>2021-05-27 16:40:34 +0300
commite3d6a599969b8244eeb447e372ec3b1eddd7534e (patch)
tree34312d2fb5c002d9d3a2b035c87088131c8cae34 /drivers/hid/amd-sfh-hid/amd_sfh_hid.c
parent82f09a637dd3215bce5314664f0171cdc3e43bb5 (diff)
downloadlinux-e3d6a599969b8244eeb447e372ec3b1eddd7534e.tar.xz
HID: amd_sfh: Use devm_kzalloc() instead of kzalloc()
Replace kzalloc with devm_kzalloc in driver initialization sequence. The allocation can be tied to the lifetime of the amd_sfh driver. This cleans up an exit & error paths, since the objects does not need to be explicitly freed anymore. Fixes: 4b2c53d93a4b ("SFH:Transport Driver to add support of AMD Sensor Fusion Hub (SFH)") Reviewed-by: Shyam Sundar S K <Shyam-sundar.S-k@amd.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/amd-sfh-hid/amd_sfh_hid.c')
-rw-r--r--drivers/hid/amd-sfh-hid/amd_sfh_hid.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
index 4f989483aa03..5ad1e7acd294 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_hid.c
@@ -162,9 +162,6 @@ void amdtp_hid_remove(struct amdtp_cl_data *cli_data)
int i;
for (i = 0; i < cli_data->num_hid_devices; ++i) {
- kfree(cli_data->feature_report[i]);
- kfree(cli_data->input_report[i]);
- kfree(cli_data->report_descr[i]);
if (cli_data->hid_sensor_hubs[i]) {
kfree(cli_data->hid_sensor_hubs[i]->driver_data);
hid_destroy_device(cli_data->hid_sensor_hubs[i]);