diff options
author | Miaoqian Lin <linmq006@gmail.com> | 2021-12-11 06:58:29 +0000 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2021-12-14 17:15:52 +0000 |
commit | 59716aa3f9764144cdd558c64f04cb83001b71ac (patch) | |
tree | 0b4e1bb480d48d3f665506bd86c7e337b7930418 /sound/soc/qcom/qdsp6 | |
parent | 833a94aac572d7f0fe3f51329e0eb9f2884cf665 (diff) |
ASoC: qdsp6: Fix an IS_ERR() vs NULL bug
The function gpr_alloc_port return ERR_PTR on errors, it doesn't return
null.
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Link: https://lore.kernel.org/r/20211211065840.1221-1-linmq006@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/qcom/qdsp6')
-rw-r--r-- | sound/soc/qcom/qdsp6/q6apm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sound/soc/qcom/qdsp6/q6apm.c b/sound/soc/qcom/qdsp6/q6apm.c index 13598ef5bacb..3e007d609a9b 100644 --- a/sound/soc/qcom/qdsp6/q6apm.c +++ b/sound/soc/qcom/qdsp6/q6apm.c @@ -630,9 +630,9 @@ struct q6apm_graph *q6apm_graph_open(struct device *dev, q6apm_cb cb, init_waitqueue_head(&graph->cmd_wait); graph->port = gpr_alloc_port(apm->gdev, dev, graph_callback, graph); - if (!graph->port) { + if (IS_ERR(graph->port)) { kfree(graph); - ret = -ENOMEM; + ret = PTR_ERR(graph->port); goto err; } |