Skip to content

Commit

Permalink
HID: amd_sfh: Fix warning unwind goto
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Basavaraj Natikar authored and Jiri Kosina committed Jan 6, 2023
1 parent b3d40c3 commit 2a33ad4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion drivers/hid/amd-sfh-hid/amd_sfh_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)
}
rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
if (rc)
return rc;
goto cleanup;
mp2_ops->start(privdata, info);
status = amd_sfh_wait_for_response
(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);
Expand Down
2 changes: 1 addition & 1 deletion drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata)
}
rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
if (rc)
return rc;
goto cleanup;

writel(0, privdata->mmio + AMD_P2C_MSG(0));
mp2_ops->start(privdata, info);
Expand Down

0 comments on commit 2a33ad4

Please sign in to comment.