Thread (31 messages) 31 messages, 3 authors, 2018-06-26
STALE2947d

[PATCH 11/11] ASoC: qdsp6: q6routing: add proper error check

From: Srinivas Kandagatla <hidden>
Date: 2018-06-25 14:31:15
Also in: alsa-devel, linux-arm-msm, linux-devicetree
Subsystem: qcom audio (asoc) drivers, sound, sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers: Srinivas Kandagatla, Jaroslav Kysela, Takashi Iwai, Liam Girdwood, Mark Brown, Linus Torvalds

q6adm_open can return error pointer or a null in error cases.
Fix this check this.

Signed-off-by: Srinivas Kandagatla <redacted>
---
 sound/soc/qcom/qdsp6/q6routing.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/qcom/qdsp6/q6routing.c b/sound/soc/qcom/qdsp6/q6routing.c
index caf2f847a886..c18f808c7730 100644
--- a/sound/soc/qcom/qdsp6/q6routing.c
+++ b/sound/soc/qcom/qdsp6/q6routing.c
@@ -310,7 +310,7 @@ int q6routing_stream_open(int fedai_id, int perf_mode,
 			      session->channels, topology, perf_mode,
 			      session->bits_per_sample, 0, 0);
 
-	if (!copp) {
+	if (IS_ERR_OR_NULL(copp)) {
 		mutex_unlock(&routing_data->lock);
 		return -EINVAL;
 	}
-- 
2.16.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help