Skip to content

Commit

Permalink
ASoC: qdsp6: Fix an IS_ERR() vs NULL bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Miaoqian Lin authored and Mark Brown committed Dec 14, 2021
1 parent 833a94a commit 59716aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sound/soc/qcom/qdsp6/q6apm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 59716aa

Please sign in to comment.