firmware: qcom_scm: don't opencode kmemdup
Subsystems (2)
PATCH v2 1/1 firmware: qcom_scm: don't opencode kmemdup
Lets not opencode kmemdup which is reported by coccinelle tool. Fix it using kmemdup.
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/firmware/qcom/qcom_scm.c:916:11-18: WARNING opportunity for kmemdup
Fixes 8b9d2050cfa0 ("firmware: qcom_scm: Add qcom_scm_pas_get_rsc_table() to get resource table")
Reported-by kernel test robot <[email protected]>
Reviewed-by Konrad Dybcio <[email protected]>
Signed-off-by Mukesh Ojha <[email protected]>
---
changes in v2: https://lore.kernel.org/lkml/[email protected]/
- Added fixes tag.
- Removed coccinelle from the Subject.
drivers/firmware/qcom/qcom_scm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/qcom/qcom_scm.c +1 -2
@@ -923,14 +923,13 @@ struct resource_table *qcom_scm_pas_get_rsc_table(struct qcom_scm_pas_context *c goto free_input_rt; } - tbl_ptr =kzalloc (size,GFP_KERNEL ); + tbl_ptr =kmemdup (output_rt_tzm, size,GFP_KERNEL );if (!tbl_ptr) {qcom_tzmem_free (output_rt_tzm); ret = -ENOMEM ; goto free_input_rt; } -memcpy (tbl_ptr, output_rt_tzm, size); *output_rt_size = size;qcom_tzmem_free (output_rt_tzm);
Signature · 1 line
2.50.1
Quoted 8 lines · Mukesh Ojha
Lets not opencode kmemdup which is reported by coccinelle tool. Fix it using kmemdup.
cocci warnings: (new ones prefixed by >>)
Quoted 1 line
Quoted 1 line
drivers/firmware/qcom/qcom_scm.c:916:11-18: WARNING opportunity for kmemdup
[...]
Applied, thanks!
[1/1] firmware: qcom_scm: don't opencode kmemdup
commit: e32701726c0e6312aabd83aa1c00f59b0d7df276
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>