Skip to content

Commit 2a33ad4

Browse files
basuamdJiri Kosina
authored andcommitted
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 <[email protected]> Reported-by: Dan Carpenter <[email protected]> Signed-off-by: Basavaraj Natikar <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent b3d40c3 commit 2a33ad4

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)