Skip to content

Commit

Permalink
firmware: qcom: scm: Remove log reporting memory allocation failure
Browse files Browse the repository at this point in the history
Remove redundant memory allocation failure.

WARNING: Possible unnecessary 'out of memory' message
+       if (!mdata_buf) {
+               dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");

Signed-off-by: Mukesh Ojha <quic_mojha@quicinc.com>
Reviewed-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/1711034642-22860-1-git-send-email-quic_mojha@quicinc.com
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
  • Loading branch information
Mukesh Ojha authored and Bjorn Andersson committed Apr 21, 2024
1 parent d6cbce2 commit 3de990f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions drivers/firmware/qcom/qcom_scm.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,9 @@ int qcom_scm_pas_init_image(u32 peripheral, const void *metadata, size_t size,
*/
mdata_buf = dma_alloc_coherent(__scm->dev, size, &mdata_phys,
GFP_KERNEL);
if (!mdata_buf) {
dev_err(__scm->dev, "Allocation of metadata buffer failed.\n");
if (!mdata_buf)
return -ENOMEM;
}

memcpy(mdata_buf, metadata, size);

ret = qcom_scm_clk_enable();
Expand Down

0 comments on commit 3de990f

Please sign in to comment.