ASoC: qdsp6: q6routing: add proper error check
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tue, 26 Jun 2018 09:20:15 +0000 (10:20 +0100)
committerMark Brown <broonie@kernel.org>
Tue, 26 Jun 2018 14:41:38 +0000 (15:41 +0100)
q6adm_open can return error pointer or a null in error cases.
Fix the return handling.

Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Acked-by: Niklas Cassel <niklas.cassel@linaro.org>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/qcom/qdsp6/q6routing.c

index ab696bf8d1d3562b6d257163ac44801f1e4a1a44..c80fdbc2442e63c6ecd8b2da1605f76555d696da 100644 (file)
@@ -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;
        }