Skip to content

Commit 225ee68

Browse files
committed
HID: amd_sfh: Fix warning unwind goto
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=2122844 Upstream Status: since Not upstream Tested: with the hid-tools test suite and some hardware commit 2a33ad4 Author: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Date: Mon Jan 2 22:00:42 2023 +0530 HID: amd_sfh: Fix warning unwind goto Return directly instead of using existing goto will not cleanup previously allocated resources. Hence replace return with goto to fix warning unwind goto which cleanups previously allocated resources. Fixes: 93ce5e0 ("HID: amd_sfh: Implement SFH1.1 functionality") Reported-by: kernel test robot <lkp@intel.com> Reported-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
1 parent 3d1d756 commit 225ee68

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
282282
}
283283
rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
284284
if (rc)
285-
return rc;
285+
goto cleanup;
286286
mp2_ops->start(privdata, info);
287287
status = amd_sfh_wait_for_response
288288
(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);

drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
160160
}
161161
rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
162162
if (rc)
163-
return rc;
163+
goto cleanup;
164164

165165
writel(0, privdata->mmio + AMD_P2C_MSG(0));
166166
mp2_ops->start(privdata, info);

0 commit comments

Comments
 (0)