提交 2a33ad4a 编写于 作者: B Basavaraj Natikar 提交者: Jiri Kosina

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: 93ce5e02 ("HID: amd_sfh: Implement SFH1.1 functionality")
Reported-by: Nkernel test robot <lkp@intel.com>
Reported-by: NDan Carpenter <error27@gmail.com>
Signed-off-by: NBasavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 b3d40c3e
...@@ -282,7 +282,7 @@ int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata) ...@@ -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]); rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
if (rc) if (rc)
return rc; goto cleanup;
mp2_ops->start(privdata, info); mp2_ops->start(privdata, info);
status = amd_sfh_wait_for_response status = amd_sfh_wait_for_response
(privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED);
......
...@@ -160,7 +160,7 @@ static int amd_sfh1_1_hid_client_init(struct amd_mp2_dev *privdata) ...@@ -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]); rc = mp2_ops->get_rep_desc(cl_idx, cl_data->report_descr[i]);
if (rc) if (rc)
return rc; goto cleanup;
writel(0, privdata->mmio + AMD_P2C_MSG(0)); writel(0, privdata->mmio + AMD_P2C_MSG(0));
mp2_ops->start(privdata, info); mp2_ops->start(privdata, info);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册